Skip to content

Commit 6221f7c

Browse files
committed
update readme
1 parent 54227ac commit 6221f7c

File tree

10 files changed

+18
-259
lines changed

10 files changed

+18
-259
lines changed

.github/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1526-minimum-number-of-increments-on-subarrays-to-form-a-target-array python hard
1+
1183-maximum-number-of-ones python hard

1152-maximum-number-of-ones/1152-maximum-number-of-ones.py

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

1152-maximum-number-of-ones/README.md

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

3501-delete-nodes-from-linked-list-present-in-array/3501-delete-nodes-from-linked-list-present-in-array.py

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

3501-delete-nodes-from-linked-list-present-in-array/README.md

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

3581-the-two-sneaky-numbers-of-digitville/3581-the-two-sneaky-numbers-of-digitville.py

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

3581-the-two-sneaky-numbers-of-digitville/README.md

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

Python/1183-maximum-number-of-ones.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# time complexity: O(n^2)
2+
# space complexity: O(n)
13
class Solution:
24
def maximumNumberOfOnes(self, width: int, height: int, sideLength: int, maxOnes: int) -> int:
35
count = []
@@ -10,4 +12,13 @@ def maximumNumberOfOnes(self, width: int, height: int, sideLength: int, maxOnes:
1012
return sum(count[:maxOnes])
1113

1214

13-
print(Solution().maximumNumberOfOnes(3, 3, 2, 1))
15+
width = 3
16+
height = 3
17+
sideLength = 2
18+
maxOnes = 1
19+
print(Solution().maximumNumberOfOnes(width, height, sideLength, maxOnes))
20+
width = 3
21+
height = 3
22+
sideLength = 2
23+
maxOnes = 2
24+
print(Solution().maximumNumberOfOnes(width, height, sideLength, maxOnes))

README.md

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -115,42 +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-
## Backtracking
122-
| |
123-
| ------- |
124-
| [0077-combinations](https://github.com/hogan-tech/leetcode-solution/tree/master/0077-combinations) |
125-
## Array
126-
| |
127-
| ------- |
128-
| [3501-delete-nodes-from-linked-list-present-in-array](https://github.com/hogan-tech/leetcode-solution/tree/master/3501-delete-nodes-from-linked-list-present-in-array) |
129-
| [3581-the-two-sneaky-numbers-of-digitville](https://github.com/hogan-tech/leetcode-solution/tree/master/3581-the-two-sneaky-numbers-of-digitville) |
130-
## Hash Table
131-
| |
132-
| ------- |
133-
| [3501-delete-nodes-from-linked-list-present-in-array](https://github.com/hogan-tech/leetcode-solution/tree/master/3501-delete-nodes-from-linked-list-present-in-array) |
134-
| [3581-the-two-sneaky-numbers-of-digitville](https://github.com/hogan-tech/leetcode-solution/tree/master/3581-the-two-sneaky-numbers-of-digitville) |
135-
## Math
136-
| |
137-
| ------- |
138-
| [1152-maximum-number-of-ones](https://github.com/hogan-tech/leetcode-solution/tree/master/1152-maximum-number-of-ones) |
139-
| [3581-the-two-sneaky-numbers-of-digitville](https://github.com/hogan-tech/leetcode-solution/tree/master/3581-the-two-sneaky-numbers-of-digitville) |
140-
## Linked List
141-
| |
142-
| ------- |
143-
| [3501-delete-nodes-from-linked-list-present-in-array](https://github.com/hogan-tech/leetcode-solution/tree/master/3501-delete-nodes-from-linked-list-present-in-array) |
144-
## Greedy
145-
| |
146-
| ------- |
147-
| [1152-maximum-number-of-ones](https://github.com/hogan-tech/leetcode-solution/tree/master/1152-maximum-number-of-ones) |
148-
## Sorting
149-
| |
150-
| ------- |
151-
| [1152-maximum-number-of-ones](https://github.com/hogan-tech/leetcode-solution/tree/master/1152-maximum-number-of-ones) |
152-
## Heap (Priority Queue)
153-
| |
154-
| ------- |
155-
| [1152-maximum-number-of-ones](https://github.com/hogan-tech/leetcode-solution/tree/master/1152-maximum-number-of-ones) |
156-
<!---LeetCode Topics End-->

Readme/1183-maximum-number-of-ones.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<h2><a href="https://leetcode.com/problems/maximum-number-of-ones/">1183. Maximum Number of Ones</a></h2><h3>Hard</h3><hr><div><p>Consider a matrix <code>M</code> with dimensions <code>width * height</code>, such that every cell has value <code>0</code>&nbsp;or <code>1</code>, and any <strong>square</strong>&nbsp;sub-matrix of <code>M</code> of size <code>sideLength * sideLength</code>&nbsp;has at most <code>maxOnes</code>&nbsp;ones.</p>
1+
<h2><a href="https://leetcode.com/problems/maximum-number-of-ones">1152. Maximum Number of Ones</a></h2><h3>Hard</h3><hr><p>Consider a matrix <code>M</code> with dimensions <code>width * height</code>, such that every cell has value <code>0</code>&nbsp;or <code>1</code>, and any <strong>square</strong>&nbsp;sub-matrix of <code>M</code> of size <code>sideLength * sideLength</code>&nbsp;has at most <code>maxOnes</code>&nbsp;ones.</p>
22

33
<p>Return the maximum possible number of ones that the matrix <code>M</code> can have.</p>
44

55
<p>&nbsp;</p>
66
<p><strong class="example">Example 1:</strong></p>
77

8-
<pre><strong>Input:</strong> width = 3, height = 3, sideLength = 2, maxOnes = 1
8+
<pre>
9+
<strong>Input:</strong> width = 3, height = 3, sideLength = 2, maxOnes = 1
910
<strong>Output:</strong> 4
1011
<strong>Explanation:</strong>
1112
In a 3*3 matrix, no 2*2 sub-matrix can have more than 1 one.
@@ -17,7 +18,8 @@ The best solution that has 4 ones is:
1718

1819
<p><strong class="example">Example 2:</strong></p>
1920

20-
<pre><strong>Input:</strong> width = 3, height = 3, sideLength = 2, maxOnes = 2
21+
<pre>
22+
<strong>Input:</strong> width = 3, height = 3, sideLength = 2, maxOnes = 2
2123
<strong>Output:</strong> 6
2224
<strong>Explanation:</strong>
2325
[1,0,1]
@@ -33,4 +35,3 @@ The best solution that has 4 ones is:
3335
<li><code>1 &lt;= sideLength &lt;= width, height</code></li>
3436
<li><code>0 &lt;= maxOnes &lt;= sideLength * sideLength</code></li>
3537
</ul>
36-
</div>

0 commit comments

Comments
 (0)