Skip to content

Commit

Permalink
Added topic pages and groupings
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanger67 committed Jul 4, 2024
1 parent c1d4069 commit e651480
Show file tree
Hide file tree
Showing 63 changed files with 2,033 additions and 419 deletions.
746 changes: 375 additions & 371 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion markdowns/Questions_By_Code_Length.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Calculations are based on the code files's byte sizes.
| 739 | [Daily Temperatures](<https://leetcode.com/problems/daily-temperatures>) | Medium | N150 | [solution](<_739. Daily Temperatures.md>) | java, py, c | Jun 13, 2024 |
| 1650 | [Lowest Common Ancestor of a Binary Tree III](<https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii>) | Medium | | [solution](<_1650. Lowest Common Ancestor of a Binary Tree III.md>) | py | Jun 09, 2024 |
| 2192 | [All Ancestors of a Node in a Directed Acyclic Graph](<https://leetcode.com/problems/all-ancestors-of-a-node-in-a-directed-acyclic-graph>) | Medium | Daily | [solution](<_2192. All Ancestors of a Node in a Directed Acyclic Graph.md>) | java, py | Jun 28, 2024 |
| 665 | [Non-decreasing Array](<https://leetcode.com/problems/non-decreasing-array>) | Medium | | [solution](<_665. Non-decreasing Array.md>) | java, py | Jun 13, 2024 |
| 3180 | w contest 401 - q3 | Medium | Contest | [solution](<_3180. w contest 401 - q.md>) | py, c | Jun 08, 2024 |
| 84 | [Largest Rectangle in Histogram](<https://leetcode.com/problems/largest-rectangle-in-histogram>) | Hard | N150 | [solution](<_84. Largest Rectangle in Histogram.md>) | py | Jun 10, 2024 |
| 1660 | [Correct a Binary Tree](<https://leetcode.com/problems/correct-a-binary-tree>) | Medium | | [solution](<_1660. Correct a Binary Tree.md>) | py | Jun 26, 2024 |
Expand Down Expand Up @@ -83,6 +82,7 @@ Calculations are based on the code files's byte sizes.
| 419 | [Battleships in a Board](<https://leetcode.com/problems/battleships-in-a-board>) | Medium | | [solution](<_419. Battleships in a Board.md>) | py, c | Jun 23, 2024 |
| 2743 | [Count Substrings Without Repeating Character](<https://leetcode.com/problems/count-substrings-without-repeating-character>) | Medium | Weekly Premium | [solution](<_2743. Count Substrings Without Repeating Character.md>) | java, py | Jun 21, 2024 |
| 1676 | [Lowest Common Ancestor of a Binary Tree IV](<https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iv>) | Medium | | [solution](<_1676. Lowest Common Ancestor of a Binary Tree IV.md>) | py | Jun 29, 2024 |
| 665 | [Non-decreasing Array](<https://leetcode.com/problems/non-decreasing-array>) | Medium | | [solution](<_665. Non-decreasing Array.md>) | java, py | Jun 13, 2024 |
| 1248 | [Count Number of Nice Subarrays](<https://leetcode.com/problems/count-number-of-nice-subarrays>) | Medium | Daily | [solution](<_1248. Count Number of Nice Subarrays.md>) | py | Jun 21, 2024 |
| 1700 | [Number of Students Unable to Eat Lunch](<https://leetcode.com/problems/number-of-students-unable-to-eat-lunch>) | Easy | | [solution](<_1700. Number of Students Unable to Eat Lunch.md>) | py | Jun 01, 2024 |
| 1980 | [Find Unique Binary String](<https://leetcode.com/problems/find-unique-binary-string>) | Medium | | [solution](<_1980. Find Unique Binary String.md>) | py, c | Jun 26, 2024 |
Expand Down
63 changes: 63 additions & 0 deletions markdowns/Topics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Topics

*[Back to top](<../README.md>)*

------

- [Array](<by_topic/Array.md>) (167 completed)
- [String](<by_topic/String.md>) (83 completed)
- [Hash Table](<by_topic/Hash Table.md>) (81 completed)
- [Depth-First Search](<by_topic/Depth-First Search.md>) (59 completed)
- [Tree](<by_topic/Tree.md>) (54 completed)
- [Sorting](<by_topic/Sorting.md>) (52 completed)
- [Binary Tree](<by_topic/Binary Tree.md>) (49 completed)
- [Math](<by_topic/Math.md>) (43 completed)
- [Breadth-First Search](<by_topic/Breadth-First Search.md>) (40 completed)
- [Two Pointers](<by_topic/Two Pointers.md>) (39 completed)
- [Stack](<by_topic/Stack.md>) (33 completed)
- [Linked List](<by_topic/Linked List.md>) (31 completed)
- [Greedy](<by_topic/Greedy.md>) (30 completed)
- [Matrix](<by_topic/Matrix.md>) (28 completed)
- [Simulation](<by_topic/Simulation.md>) (24 completed)
- [Bit Manipulation](<by_topic/Bit Manipulation.md>) (22 completed)
- [Database](<by_topic/Database.md>) (18 completed)
- [Trie](<by_topic/Trie.md>) (18 completed)
- [Binary Search](<by_topic/Binary Search.md>) (17 completed)
- [Design](<by_topic/Design.md>) (17 completed)
- [Dynamic Programming](<by_topic/Dynamic Programming.md>) (15 completed)
- [Heap (Priority Queue)](<by_topic/Heap (Priority Queue).md>) (15 completed)
- [Recursion](<by_topic/Recursion.md>) (14 completed)
- [Backtracking](<by_topic/Backtracking.md>) (13 completed)
- [Counting](<by_topic/Counting.md>) (13 completed)
- [Binary Search Tree](<by_topic/Binary Search Tree.md>) (11 completed)
- [Prefix Sum](<by_topic/Prefix Sum.md>) (10 completed)
- [Sliding Window](<by_topic/Sliding Window.md>) (10 completed)
- [Queue](<by_topic/Queue.md>) (8 completed)
- [Monotonic Stack](<by_topic/Monotonic Stack.md>) (8 completed)
- [Union Find](<by_topic/Union Find.md>) (7 completed)
- [Divide and Conquer](<by_topic/Divide and Conquer.md>) (6 completed)
- [String Matching](<by_topic/String Matching.md>) (6 completed)
- [Graph](<by_topic/Graph.md>) (6 completed)
- [Hash Function](<by_topic/Hash Function.md>) (4 completed)
- [Combinatorics](<by_topic/Combinatorics.md>) (4 completed)
- [Monotonic Queue](<by_topic/Monotonic Queue.md>) (3 completed)
- [Iterator](<by_topic/Iterator.md>) (3 completed)
- [Bucket Sort](<by_topic/Bucket Sort.md>) (3 completed)
- [Geometry](<by_topic/Geometry.md>) (2 completed)
- [Counting Sort](<by_topic/Counting Sort.md>) (2 completed)
- [Brainteaser](<by_topic/Brainteaser.md>) (2 completed)
- [Game Theory](<by_topic/Game Theory.md>) (2 completed)
- [Interactive](<by_topic/Interactive.md>) (2 completed)
- [Memoization](<by_topic/Memoization.md>) (2 completed)
- [Rolling Hash](<by_topic/Rolling Hash.md>) (2 completed)
- [Quickselect](<by_topic/Quickselect.md>) (2 completed)
- [Randomized](<by_topic/Randomized.md>) (2 completed)
- [Doubly-Linked List](<by_topic/Doubly-Linked List.md>) (2 completed)
- [Bitmask](<by_topic/Bitmask.md>) (1 completed)
- [Merge Sort](<by_topic/Merge Sort.md>) (1 completed)
- [Ordered Set](<by_topic/Ordered Set.md>) (1 completed)
- [Suffix Array](<by_topic/Suffix Array.md>) (1 completed)
- [Topological Sort](<by_topic/Topological Sort.md>) (1 completed)
- [Shortest Path](<by_topic/Shortest Path.md>) (1 completed)
- [Number Theory](<by_topic/Number Theory.md>) (1 completed)
- [Reservoir Sampling](<by_topic/Reservoir Sampling.md>) (1 completed)
49 changes: 25 additions & 24 deletions markdowns/_665. Non-decreasing Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> *First completed : June 13, 2024*
>
> *Last updated : July 01, 2024*
> *Last updated : July 03, 2024*

------
Expand All @@ -18,6 +18,30 @@

*To see the question prompt, click the title.*

> Idea
> Go through each adjacent pairing until you find an increasing pairing
>
> If found, check to see if it's the last value causing the decrease.
> Return True if it is cause we can just change to be infinity or starmap
>
> Iterate through the values to the right of the issue section to see if
> there's another issue. If there is, return False cause we're only alowed
> to modify one value.
>
> Return True if the problem value is the first pairing, since we can just
> nums[0] = -inf to solve it
>
> Return True if by deleting the value or by deleting the value before, the
> two halves connect and are non-decreasing.
>
> It's an OR cause it could be smt like [1, 2, 5, 7, 3, 5, 6] where (7, 3) is
> the flagged pair but (5, 3) by deleting 7 doesn't work and (7, 5) by deleting
> 3 also doesn't work
>
> If no increasing pair found at all, return true
------

## Solutions

- [m665.java](<../my-submissions/m665.java>)
Expand Down Expand Up @@ -57,29 +81,6 @@ class Solution {
### Python
#### [m665.py](<../my-submissions/m665.py>)
```Python
''' Idea
Go through each adjacent pairing until you find an increasing pairing
If found, check to see if it's the last value causing the decrease.
Return True if it is cause we can just change to be infinity or starmap
Iterate through the values to the right of the issue section to see if
there's another issue. If there is, return False cause we're only alowed
to modify one value.
Return True if the problem value is the first pairing, since we can just
nums[0] = -inf to solve it
Return True if by deleting the value or by deleting the value before, the
two halves connect and are non-decreasing.
It's an OR cause it could be smt like [1, 2, 5, 7, 3, 5, 6] where (7, 3) is
the flagged pair but (5, 3) by deleting 7 doesn't work and (7, 5) by deleting
3 also doesn't work
If no increasing pair found at all, return true
'''

class Solution:
def checkPossibility(self, nums: List[int]) -> bool:
for i in range(1, len(nums)) :
Expand Down
Loading

0 comments on commit e651480

Please sign in to comment.