Skip to content

Commit cae2064

Browse files
committedJun 29, 2024
Fixed discrepancy (missing file) with my actual profile after noticing stats number difference
1 parent 09d01ea commit cae2064

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed
 

‎README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Profile: [Zanger](https://leetcode.com/u/Zanger/)
99
| | **C** | **Cpp** | **Java** | **Js** | **Kt** | **Py** | **Rb** | **Rs** | **Sql** | **Total** | **Total Unique** |
1010
|:-----------|:--------|:----------|:-----------|:---------|:---------|:---------|:---------|:---------|:----------|:------------|:-------------------|
1111
| **Easy** | 34 | 1 | 33 | 0 | 0 | 66 | 0 | 0 | 14 | *148* | *94* |
12-
| **Medium** | 47 | 6 | 52 | 2 | 2 | 229 | 2 | 2 | 4 | *346* | *206* |
13-
| **Hard** | 2 | 0 | 1 | 0 | 0 | 23 | 0 | 0 | 0 | *26* | *18* |
14-
| **Total** | *83* | *7* | *86* | *2* | *2* | *318* | *2* | *2* | *18* | **520** | **318** |
12+
| **Medium** | 47 | 6 | 52 | 2 | 2 | 230 | 2 | 2 | 4 | *347* | *207* |
13+
| **Hard** | 2 | 0 | 1 | 0 | 0 | 23 | 0 | 0 | 0 | *26* | *17* |
14+
| **Total** | *83* | *7* | *86* | *2* | *2* | *319* | *2* | *2* | *18* | **521** | **318** |
1515

16-
Questions done in multiple languages and/or multiple ways: 202
16+
Questions done in multiple languages and/or multiple ways: 203
1717
<br>
1818
Unique questions done: **318**
1919

@@ -283,6 +283,7 @@ Unique questions done: **318**
283283
| Medium | 1804 | [Implement Trie II (Prefix Tree)](<https://leetcode.com/problems/implement-trie-ii-prefix-tree>) | | [py](<my-submissions/m1804.py>) | | | | |
284284
| Medium | 1833 | [Maximum Ice Cream Bars](<https://leetcode.com/problems/maximum-ice-cream-bars>) | | [py](<my-submissions/m1833.py>) | [java](<my-submissions/m1833.java>) | | [c](<my-submissions/m1833.c>) | |
285285
| Medium | 1852 | [Distinct Numbers in Each Subarray](<https://leetcode.com/problems/distinct-numbers-in-each-subarray>) | | | [java](<my-submissions/m1852.java>) | | | |
286+
| Medium | 1858 | [Longest Word With All Prefixes](<https://leetcode.com/problems/longest-word-with-all-prefixes>) | | [py](<my-submissions/m1858.py>) | | | | |
286287
| Medium | 1874 | [Minimize Product Sum of Two Arrays](<https://leetcode.com/problems/minimize-product-sum-of-two-arrays>) | | | [java](<my-submissions/m1874.java>) | | [c](<my-submissions/m1874.c>) | |
287288
| Medium | 1877 | [Minimize Maximum Pair Sum in Array](<https://leetcode.com/problems/minimize-maximum-pair-sum-in-array>) | | [py](<my-submissions/m1877 nlogn.py>) | | | | |
288289
| Medium | 1885 | [Count Pairs in Two Arrays](<https://leetcode.com/problems/count-pairs-in-two-arrays>) | Weekly Premium | [py](<my-submissions/m1885 Weekly Premium.py>) | | | | |
@@ -341,7 +342,7 @@ Unique questions done: **318**
341342
| Hard | 23 | [Merge k Sorted Lists](<https://leetcode.com/problems/merge-k-sorted-lists>) | B75, N150 | [py](<my-submissions/h23.py>) | | | | |
342343
| Hard | 25 | [Reverse Nodes in k-Group](<https://leetcode.com/problems/reverse-nodes-in-k-group>) | N150 | | | | [c](<my-submissions/h25.c>) | |
343344
| Hard | 84 | [Largest Rectangle in Histogram](<https://leetcode.com/problems/largest-rectangle-in-histogram>) | N150 | [py](<my-submissions/h84 v1.py>), [py](<my-submissions/h84 v2 Optimized Stack.py>) | | | | |
344-
| Hard | 212 | [Word Search II](<https://leetcode.com/problems/word-search-ii>) | B75, N150 | [py](<my-submissions/h212 v1 Brute Force Trie.py>) | | | | |
345+
| Hard | 212 | [Word Search II](<https://leetcode.com/problems/word-search-ii>) | B75, N150 | [py](<my-submissions/h212 v1 Brute Force Trie.py>), [py](<my-submissions/h212 v2 Trie with removal of words once found once.py>) | | | | |
345346
| Hard | 224 | [Basic Calculator](<https://leetcode.com/problems/basic-calculator>) | | [py](<my-submissions/h224.py>) | | | | |
346347
| Hard | 239 | [Sliding Window Maximum](<https://leetcode.com/problems/sliding-window-maximum>) | N150 | [py](<my-submissions/h239 v1.py>), [py](<my-submissions/h239 v2.py>) | | | | |
347348
| Hard | 273 | [Integer to English Words](<https://leetcode.com/problems/integer-to-english-words>) | | [py](<my-submissions/h273.py>) | | | | |
@@ -352,7 +353,6 @@ Unique questions done: **318**
352353
| Hard | 995 | [Minimum Number of K Consecutive Bit Flips](<https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips>) | Daily | [py](<my-submissions/h995.py>) | | | [c](<my-submissions/h995 Daily.c>) | |
353354
| Hard | 1255 | [Maximum Score Words Formed by Letters](<https://leetcode.com/problems/maximum-score-words-formed-by-letters>) | | [py](<my-submissions/h1255 v1.py>) | | | | |
354355
| Hard | 1284 | [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](<https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix>) | | [py](<my-submissions/h1284 converted for booleans.py>), [py](<my-submissions/h1284.py>) | | | | |
355-
| Hard | 2112 | [The Airport With the Most Traffic](<https://leetcode.com/problems/the-airport-with-the-most-traffic>) | | [py](<my-submissions/h2112 v2 Trie with removal of words once found once.py>) | | | | |
356356
| Hard | 2258 | [Escape the Spreading Fire](<https://leetcode.com/problems/escape-the-spreading-fire>) | | [py](<my-submissions/h2258 v1 with all the records of my pain.py>), [py](<my-submissions/h2258 v2 cleaned but still ugly.py>) | | | | |
357357
| Hard | 2954 | [Count the Number of Infection Sequences](<https://leetcode.com/problems/count-the-number-of-infection-sequences>) | | [py](<my-submissions/h2954.py>) | | | | |
358358
| Hard | 3045 | [Count Prefix and Suffix Pairs II](<https://leetcode.com/problems/count-prefix-and-suffix-pairs-ii>) | | [py](<my-submissions/h3045.py>) | | | | |

‎my-submissions/m1858.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class Solution:
2+
def longestWord(self, words: List[str]) -> str:
3+
words.sort(key=lambda x: len(x))
4+
5+
trie = {}
6+
maxx = 0
7+
maxxWord = ['']
8+
for word in words :
9+
curr = trie
10+
for i, c in enumerate(word) :
11+
if i == len(word) - 1 :
12+
if maxx < len(word) :
13+
maxx = len(word)
14+
maxxWord = [word]
15+
elif maxx == len(word) :
16+
maxxWord.append(word)
17+
18+
curr[c] = {}
19+
break
20+
if c in curr :
21+
curr = curr[c]
22+
else :
23+
break
24+
25+
return sorted(maxxWord)[0]

0 commit comments

Comments
 (0)
Please sign in to comment.