Skip to content

Commit 871fbc4

Browse files
committed
update readme
1 parent bfd4139 commit 871fbc4

File tree

9 files changed

+18
-194
lines changed

9 files changed

+18
-194
lines changed

.github/test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
3731-find-missing-elements python easy
22
3732-maximum-product-of-three-elements-after-one-replacement python medium
3-
3733-minimum-time-to-complete-all-deliveries python medium
3+
3733-minimum-time-to-complete-all-deliveries python medium
4+
3318-find-x-sum-of-all-k-long-subarrays-i python easy

1700-minimum-time-to-make-rope-colorful/1700-minimum-time-to-make-rope-colorful.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

1700-minimum-time-to-make-rope-colorful/README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

3610-find-x-sum-of-all-k-long-subarrays-i/3610-find-x-sum-of-all-k-long-subarrays-i.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

3610-find-x-sum-of-all-k-long-subarrays-i/README.md

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# time complexity: O(n^2)
1+
# time complexity: O(n^2 * klogk)
22
# space complexity: O(n)
33
from typing import Counter, List
44

55

66
class Solution:
77
def findXSum(self, nums: List[int], k: int, x: int) -> List[int]:
88
n = len(nums)
9-
ans = []
9+
result = []
1010

1111
for i in range(n - k + 1):
1212
items = list(Counter(nums[i:i+k]).items())
@@ -16,12 +16,20 @@ def findXSum(self, nums: List[int], k: int, x: int) -> List[int]:
1616
for j in range(min(x, len(items))):
1717
tempSum += items[j][0] * items[j][1]
1818

19-
ans.append(tempSum)
19+
result.append(tempSum)
2020

21-
return ans
21+
return result
2222

2323

24-
nums = [2, 5, 3, 5, 1]
24+
nums = [1, 1, 2, 2, 3, 4, 2, 3]
25+
k = 6
26+
x = 2
27+
print(Solution().findXSum(nums, k, x))
28+
nums = [3, 8, 7, 8, 7, 5]
2529
k = 2
26-
x = 1
30+
x = 2
31+
print(Solution().findXSum(nums, k, x))
32+
nums = [9, 2, 2]
33+
k = 3
34+
x = 3
2735
print(Solution().findXSum(nums, k, x))

Question_List_3001_4000.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
| 3217 | [Delete Nodes From Linked List Present In Array](https://leetcode.com/problems/delete-nodes-from-linked-list-present-in-array/) | [Python](./Python/3217-delete-nodes-from-linked-list-present-in-array.py) | [Medium](./Readme/3217-delete-nodes-from-linked-list-present-in-array.md) |
6767
| 3223 | [Minimum Length of String After Operations](https://leetcode.com/problems/minimum-length-of-string-after-operations) | [Python](./Python/3223-minimum-length-of-string-after-operations.py) | [Medium](./Readme/3223-minimum-length-of-string-after-operations.md) |
6868
| 3227 | [Vowels Game in a String](https://leetcode.com/problems/vowels-game-in-a-string) | [Python](./Python/3227-vowels-game-in-a-string.py) | [Medium](./Readme/3227-vowels-game-in-a-string.md) |
69+
| 3233 | [Find the Count of Numbers Which Are Not Special](https://leetcode.com/problems/find-the-count-of-numbers-which-are-not-special) | [Python](./Python/3233-find-the-count-of-numbers-which-are-not-special.py) | [Medium](./Readme/3233-find-the-count-of-numbers-which-are-not-special.md) |
6970
| 3239 | [Minimum Number of Flips to Make Binary Grid Palindromic I](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-i) | [Python](./Python/3239-minimum-number-of-flips-to-make-binary-grid-palindromic-i.py) | [Medium](./Readme/3239-minimum-number-of-flips-to-make-binary-grid-palindromic-i.md) |
7071
| 3243 | [Shortest Distance After Road Addition Queries I](https://leetcode.com/problems/shortest-distance-after-road-addition-queries-i) | [Python](./Python/3243-shortest-distance-after-road-addition-queries-i.py) | [Medium](./Readme/3243-shortest-distance-after-road-addition-queries-i.md) |
7172
| 3249 | [Count the Number of Good Nodes](https://leetcode.com/problems/count-the-number-of-good-nodes) | [Python](./Python/3249-count-the-number-of-good-nodes.py) | [Medium](./Readme/3249-count-the-number-of-good-nodes.md) |
@@ -99,7 +100,6 @@
99100
| 3325 | [Count Substrings with K Frequency Characters I](https://leetcode.com/problems/count-substrings-with-k-frequency-characters-i) | [Python](./Python/3325-count-substrings-with-k-frequency-characters-i.py) | [Medium](./Readme/3325-count-substrings-with-k-frequency-characters-i.md) |
100101
| 3330 | [Find the Original Typed String I](https://leetcode.com/problems/find-the-original-typed-string-i) | [Python](./Python/3330-find-the-original-typed-string-i.py) | [Easy](./Readme/3330-find-the-original-typed-string-i.md) |
101102
| 3331 | [Find Subtree Sizes After Changes](https://leetcode.com/problems/find-subtree-sizes-after-changes) | [Python](./Python/3331-find-subtree-sizes-after-changes.py) | [Medium](./Readme/3331-find-subtree-sizes-after-changes.md) |
102-
| 3233 | [Find the Count of Numbers Which Are Not Special](https://leetcode.com/problems/find-the-count-of-numbers-which-are-not-special) | [Python](./Python/3233-find-the-count-of-numbers-which-are-not-special.py) | [Medium](./Readme/3233-find-the-count-of-numbers-which-are-not-special.md) |
103103
| 3334 | [Find the Maximum Factor Score of Array](https://leetcode.com/problems/find-the-maximum-factor-score-of-array) | [Python](./Python/3334-find-the-maximum-factor-score-of-array.py) | [Medium](./Readme/3334-find-the-maximum-factor-score-of-array.md) |
104104
| 3335 | [Total Characters in String After Transformations I](https://leetcode.com/problems/total-characters-in-string-after-transformations-i) | [Python](./Python/3335-total-characters-in-string-after-transformations-i.py) | [Medium](./Readme/3335-total-characters-in-string-after-transformations-i.md) |
105105
| 3337 | [Total Characters in String After Transformations II](https://leetcode.com/problems/total-characters-in-string-after-transformations-ii) | [Python](./Python/3337-total-characters-in-string-after-transformations-ii.py) | [Hard](./Readme/3337-total-characters-in-string-after-transformations-ii.md) |

README.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -115,36 +115,3 @@ It helps others discover the repo and keeps the project growing.
115115
---
116116

117117
Feedback / Questions → open an Issue or reach out on [LinkedIn](https://www.linkedin.com/in/hogan-l/)
118-
119-
<!---LeetCode Topics Start-->
120-
# LeetCode Topics
121-
## Array
122-
| |
123-
| ------- |
124-
| [1700-minimum-time-to-make-rope-colorful](https://github.com/hogan-tech/leetcode-solution/tree/master/1700-minimum-time-to-make-rope-colorful) |
125-
| [3610-find-x-sum-of-all-k-long-subarrays-i](https://github.com/hogan-tech/leetcode-solution/tree/master/3610-find-x-sum-of-all-k-long-subarrays-i) |
126-
## String
127-
| |
128-
| ------- |
129-
| [1700-minimum-time-to-make-rope-colorful](https://github.com/hogan-tech/leetcode-solution/tree/master/1700-minimum-time-to-make-rope-colorful) |
130-
## Dynamic Programming
131-
| |
132-
| ------- |
133-
| [1700-minimum-time-to-make-rope-colorful](https://github.com/hogan-tech/leetcode-solution/tree/master/1700-minimum-time-to-make-rope-colorful) |
134-
## Greedy
135-
| |
136-
| ------- |
137-
| [1700-minimum-time-to-make-rope-colorful](https://github.com/hogan-tech/leetcode-solution/tree/master/1700-minimum-time-to-make-rope-colorful) |
138-
## Hash Table
139-
| |
140-
| ------- |
141-
| [3610-find-x-sum-of-all-k-long-subarrays-i](https://github.com/hogan-tech/leetcode-solution/tree/master/3610-find-x-sum-of-all-k-long-subarrays-i) |
142-
## Sliding Window
143-
| |
144-
| ------- |
145-
| [3610-find-x-sum-of-all-k-long-subarrays-i](https://github.com/hogan-tech/leetcode-solution/tree/master/3610-find-x-sum-of-all-k-long-subarrays-i) |
146-
## Heap (Priority Queue)
147-
| |
148-
| ------- |
149-
| [3610-find-x-sum-of-all-k-long-subarrays-i](https://github.com/hogan-tech/leetcode-solution/tree/master/3610-find-x-sum-of-all-k-long-subarrays-i) |
150-
<!---LeetCode Topics End-->

Readme/3318-find-x-sum-of-all-k-long-subarrays-i.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2><a href="https://leetcode.com/problems/find-x-sum-of-all-k-long-subarrays-i/">3318. Find X-Sum of All K-Long Subarrays I</a></h2><h3>Easy</h3><hr><div><p>You are given an array <code>nums</code> of <code>n</code> integers and two integers <code>k</code> and <code>x</code>.</p>
1+
<h2><a href="https://leetcode.com/problems/find-x-sum-of-all-k-long-subarrays-i">3610. Find X-Sum of All K-Long Subarrays I</a></h2><h3>Easy</h3><hr><p>You are given an array <code>nums</code> of <code>n</code> integers and two integers <code>k</code> and <code>x</code>.</p>
22

33
<p>The <strong>x-sum</strong> of an array is calculated by the following procedure:</p>
44

@@ -12,8 +12,6 @@
1212

1313
<p>Return an integer array <code>answer</code> of length <code>n - k + 1</code> where <code>answer[i]</code> is the <strong>x-sum</strong> of the <span data-keyword="subarray-nonempty">subarray</span> <code>nums[i..i + k - 1]</code>.</p>
1414

15-
<p>A <strong>subarray</strong> is a contiguous <b>non-empty</b> sequence of elements within an array.</p>
16-
1715
<p>&nbsp;</p>
1816
<p><strong class="example">Example 1:</strong></p>
1917

@@ -51,4 +49,3 @@
5149
<li><code>1 &lt;= nums[i] &lt;= 50</code></li>
5250
<li><code>1 &lt;= x &lt;= k &lt;= nums.length</code></li>
5351
</ul>
54-
</div>

0 commit comments

Comments
 (0)