Skip to content

Commit

Permalink
Updated markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanger67/leetcode authored and Zanger67/leetcode committed Dec 18, 2024
1 parent 65dc832 commit b5f7287
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **[LeetCode Records](https://leetcode.com/u/Zanger/)** (554 solved)
# **[LeetCode Records](https://leetcode.com/u/Zanger/)** (555 solved)

<!-- This readme was generated using [WikiLeet](<https://github.com/Zanger67/WikiLeet>) -->

Expand Down Expand Up @@ -382,6 +382,7 @@ This repo is a collection of my LeetCode solutions, primarily written in Python,
| 1470 | [Shuffle the Array](<https://leetcode.com/problems/shuffle-the-array>) | Easy | | [solution](<markdowns/_1470. Shuffle the Array.md>) | c |
| 1472 | [Design Browser History](<https://leetcode.com/problems/design-browser-history>) | Medium | | [solution](<markdowns/_1472. Design Browser History.md>) | py |
| 1474 | [Delete N Nodes After M Nodes of a Linked List](<https://leetcode.com/problems/delete-n-nodes-after-m-nodes-of-a-linked-list>) | Easy | | [solution](<markdowns/_1474. Delete N Nodes After M Nodes of a Linked List.md>) | c, java |
| 1475 | [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>) | Easy | Daily | [solution](<markdowns/_1475. Final Prices With a Special Discount in a Shop.md>) | py |
| 1481 | [Least Number of Unique Integers after K Removals](<https://leetcode.com/problems/least-number-of-unique-integers-after-k-removals>) | Medium | | [solution](<markdowns/_1481. Least Number of Unique Integers after K Removals.md>) | py |
| 1482 | [Minimum Number of Days to Make m Bouquets](<https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets>) | Medium | Daily | [solution](<markdowns/_1482. Minimum Number of Days to Make m Bouquets.md>) | py |
| 1490 | [Clone N-ary Tree](<https://leetcode.com/problems/clone-n-ary-tree>) | Medium | | [solution](<markdowns/_1490. Clone N-ary Tree.md>) | java, py |
Expand Down
1 change: 1 addition & 0 deletions markdowns/Daily_Questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Dates are for the date I completed the question so due to the my time zone and h

| # | Title | Level | Cats | Solution | Languages | Date Complete |
|-----:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------|:------------|:----------------------------------------------------------------------------------------------------|:-----------------------------|:----------------|
| 1475 | [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>) | Easy | Daily | [solution](<_1475. Final Prices With a Special Discount in a Shop.md>) | py | Dec 18, 2024 |
| 1455 | [Check If a Word Occurs As a Prefix of Any Word in a Sentence](<https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence>) | Easy | Daily | [solution](<_1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence.md>) | py | Dec 02, 2024 |
| 3163 | [String Compression III](<https://leetcode.com/problems/string-compression-iii>) | Medium | Daily | [solution](<_3163. String Compression III.md>) | py | Nov 04, 2024 |
| 2684 | [Maximum Number of Moves in a Grid](<https://leetcode.com/problems/maximum-number-of-moves-in-a-grid>) | Medium | Daily | [solution](<_2684. Maximum Number of Moves in a Grid.md>) | py | Oct 29, 2024 |
Expand Down
3 changes: 2 additions & 1 deletion markdowns/Easy.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Easy Questions (163)
# Easy Questions (164)

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

Expand Down Expand Up @@ -105,6 +105,7 @@
| 1460 | [Make Two Arrays Equal by Reversing Subarrays](<https://leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays>) | Easy | Daily | [solution](<_1460. Make Two Arrays Equal by Reversing Subarrays.md>) | c, py | Jun 04, 2024 |
| 1470 | [Shuffle the Array](<https://leetcode.com/problems/shuffle-the-array>) | Easy | | [solution](<_1470. Shuffle the Array.md>) | c | Jun 03, 2024 |
| 1474 | [Delete N Nodes After M Nodes of a Linked List](<https://leetcode.com/problems/delete-n-nodes-after-m-nodes-of-a-linked-list>) | Easy | | [solution](<_1474. Delete N Nodes After M Nodes of a Linked List.md>) | c, java | Jun 07, 2024 |
| 1475 | [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>) | Easy | Daily | [solution](<_1475. Final Prices With a Special Discount in a Shop.md>) | py | Dec 18, 2024 |
| 1502 | [Can Make Arithmetic Progression From Sequence](<https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence>) | Easy | | [solution](<_1502. Can Make Arithmetic Progression From Sequence.md>) | c, py | Jun 04, 2024 |
| 1518 | [Water Bottles](<https://leetcode.com/problems/water-bottles>) | Easy | Daily | [solution](<_1518. Water Bottles.md>) | c, cpp, cs, java, js, py, ts | Jul 07, 2024 |
| 1550 | [Three Consecutive Odds](<https://leetcode.com/problems/three-consecutive-odds>) | Easy | Daily | [solution](<_1550. Three Consecutive Odds.md>) | c, py | Jul 01, 2024 |
Expand Down
1 change: 1 addition & 0 deletions markdowns/Questions_By_Code_Length.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ Calculations are based on the code files's byte sizes.
| 945 | [Minimum Increment to Make Array Unique](<https://leetcode.com/problems/minimum-increment-to-make-array-unique>) | Medium | Daily | [solution](<_945. Minimum Increment to Make Array Unique.md>) | py | Jun 14, 2024 |
| 1376 | [Time Needed to Inform All Employees](<https://leetcode.com/problems/time-needed-to-inform-all-employees>) | Medium | | [solution](<_1376. Time Needed to Inform All Employees.md>) | py | Oct 26, 2024 |
| 977 | [Squares of a Sorted Array](<https://leetcode.com/problems/squares-of-a-sorted-array>) | Easy | | [solution](<_977. Squares of a Sorted Array.md>) | py | Jun 21, 2024 |
| 1475 | [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>) | Easy | Daily | [solution](<_1475. Final Prices With a Special Discount in a Shop.md>) | py | Dec 18, 2024 |
| 1748 | [Sum of Unique Elements](<https://leetcode.com/problems/sum-of-unique-elements>) | Easy | | [solution](<_1748. Sum of Unique Elements.md>) | c | Jun 06, 2024 |
| 1436 | [Destination City](<https://leetcode.com/problems/destination-city>) | Easy | | [solution](<_1436. Destination City.md>) | java | Jun 01, 2024 |
| 330 | [Patching Array](<https://leetcode.com/problems/patching-array>) | Hard | Daily | [solution](<_330. Patching Array.md>) | py | Jun 16, 2024 |
Expand Down
1 change: 1 addition & 0 deletions markdowns/Questions_By_Recent.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Calculations are based on the date of the first solve.

| # | Title | Level | Cats | Solution | Languages | Date Complete |
|-----:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------|:---------------|:----------------------------------------------------------------------------------------------------|:--------------------------------------------|:----------------|
| 1475 | [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>) | Easy | Daily | [solution](<_1475. Final Prices With a Special Discount in a Shop.md>) | py | Dec 18, 2024 |
| 81 | [Search in Rotated Sorted Array II](<https://leetcode.com/problems/search-in-rotated-sorted-array-ii>) | Medium | | [solution](<_81. Search in Rotated Sorted Array II.md>) | py | Dec 17, 2024 |
| 33 | [Search in Rotated Sorted Array](<https://leetcode.com/problems/search-in-rotated-sorted-array>) | Medium | B75, N150 | [solution](<_33. Search in Rotated Sorted Array.md>) | py | Dec 17, 2024 |
| 1957 | [Delete Characters to Make Fancy String](<https://leetcode.com/problems/delete-characters-to-make-fancy-string>) | Easy | | [solution](<_1957. Delete Characters to Make Fancy String.md>) | py | Nov 04, 2024 |
Expand Down
6 changes: 3 additions & 3 deletions markdowns/Topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

------

- [Array](<by_topic/Array.md>) (267 completed)
- [Array](<by_topic/Array.md>) (268 completed)
- [String](<by_topic/String.md>) (127 completed)
- [Hash Table](<by_topic/Hash Table.md>) (124 completed)
- [Depth-First Search](<by_topic/Depth-First Search.md>) (92 completed)
Expand All @@ -14,7 +14,7 @@
- [Math](<by_topic/Math.md>) (67 completed)
- [Breadth-First Search](<by_topic/Breadth-First Search.md>) (60 completed)
- [Two Pointers](<by_topic/Two Pointers.md>) (55 completed)
- [Stack](<by_topic/Stack.md>) (51 completed)
- [Stack](<by_topic/Stack.md>) (52 completed)
- [Dynamic Programming](<by_topic/Dynamic Programming.md>) (47 completed)
- [Matrix](<by_topic/Matrix.md>) (46 completed)
- [Linked List](<by_topic/Linked List.md>) (45 completed)
Expand All @@ -34,7 +34,7 @@
- [Sliding Window](<by_topic/Sliding Window.md>) (15 completed)
- [Queue](<by_topic/Queue.md>) (14 completed)
- [Graph](<by_topic/Graph.md>) (12 completed)
- [Monotonic Stack](<by_topic/Monotonic Stack.md>) (10 completed)
- [Monotonic Stack](<by_topic/Monotonic Stack.md>) (11 completed)
- [Union Find](<by_topic/Union Find.md>) (9 completed)
- [Divide and Conquer](<by_topic/Divide and Conquer.md>) (7 completed)
- [String Matching](<by_topic/String Matching.md>) (7 completed)
Expand Down
44 changes: 44 additions & 0 deletions markdowns/_1475. Final Prices With a Special Discount in a Shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 1475. [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>)

*All prompts are owned by LeetCode. To view the prompt, click the title link above.*

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

------

> *First completed : December 18, 2024*
>
> *Last updated : December 18, 2024*
------

> **Related Topics** : **[Array](<by_topic/Array.md>), [Stack](<by_topic/Stack.md>), [Monotonic Stack](<by_topic/Monotonic Stack.md>)**
>
> **Acceptance Rate** : **78.81 %**
------

## Solutions

- [e1475.py](<../my-submissions/e1475.py>)
### Python
#### [e1475.py](<../my-submissions/e1475.py>)
```Python
class Solution:
def finalPrices(self, prices: List[int]) -> List[int]:
output = [-1] * len(prices)

for i in range(len(prices) - 1, -1, -1) :
price = prices[i]
maxx = 0
for disc in prices[i + 1:] :
if disc > price :
continue
maxx = disc
break
output[i] = price - maxx

return output

```

3 changes: 2 additions & 1 deletion markdowns/by_topic/Array.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Array](<https://leetcode.com/tag/Array/>) (267 completed)
# [Array](<https://leetcode.com/tag/Array/>) (268 completed)

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

Expand Down Expand Up @@ -162,6 +162,7 @@
| 1460 | [Make Two Arrays Equal by Reversing Subarrays](<https://leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays>) | Easy | Daily | [solution](<../_1460. Make Two Arrays Equal by Reversing Subarrays.md>) | c, py | Jun 04, 2024 |
| 1470 | [Shuffle the Array](<https://leetcode.com/problems/shuffle-the-array>) | Easy | | [solution](<../_1470. Shuffle the Array.md>) | c | Jun 03, 2024 |
| 1472 | [Design Browser History](<https://leetcode.com/problems/design-browser-history>) | Medium | | [solution](<../_1472. Design Browser History.md>) | py | Jul 06, 2024 |
| 1475 | [Final Prices With a Special Discount in a Shop](<https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop>) | Easy | Daily | [solution](<../_1475. Final Prices With a Special Discount in a Shop.md>) | py | Dec 18, 2024 |
| 1481 | [Least Number of Unique Integers after K Removals](<https://leetcode.com/problems/least-number-of-unique-integers-after-k-removals>) | Medium | | [solution](<../_1481. Least Number of Unique Integers after K Removals.md>) | py | Jun 15, 2024 |
| 1482 | [Minimum Number of Days to Make m Bouquets](<https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets>) | Medium | Daily | [solution](<../_1482. Minimum Number of Days to Make m Bouquets.md>) | py | Jun 19, 2024 |
| 1497 | [Check If Array Pairs Are Divisible by k](<https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k>) | Medium | Daily | [solution](<../_1497. Check If Array Pairs Are Divisible by k.md>) | py | Oct 01, 2024 |
Expand Down
Loading

0 comments on commit b5f7287

Please sign in to comment.