Skip to content

Commit d614bbc

Browse files
author
Carlos Gutierrez
committed
Update README.md with new LeetCode problems and reorder table by problem number
1 parent 41c502a commit d614bbc

File tree

3 files changed

+163
-48
lines changed

3 files changed

+163
-48
lines changed

README.md

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This repo tracks my journey solving LeetCode problems — not just code, but my thought process, reflections, and patterns I'm mastering.
44

5-
[![LeetCode Problems](https://img.shields.io/badge/LeetCode-75%2B%20Solved-brightgreen?style=for-the-badge&logo=leetcode)](https://leetcode.com/u/cargdev/)
5+
[![LeetCode Problems](https://img.shields.io/badge/LeetCode-79%2B%20Solved-brightgreen?style=for-the-badge&logo=leetcode)](https://leetcode.com/u/cargdev/)
66
[![Python](https://img.shields.io/badge/Python-3.8%2B-blue?style=for-the-badge&logo=python)](https://www.python.org/)
77
[![JavaScript](https://img.shields.io/badge/JavaScript-ES6%2B-yellow?style=for-the-badge&logo=javascript)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
88
[![SQL](https://img.shields.io/badge/SQL-MySQL%2B-orange?style=for-the-badge&logo=mysql)](https://www.mysql.com/)
@@ -18,9 +18,9 @@ This repo tracks my journey solving LeetCode problems — not just code, but my
1818
[![Success Rate](https://img.shields.io/badge/Success%20Rate-95%25-brightgreen?style=flat-square)](https://leetcode.com/u/cargdev/)
1919
[![Streak](https://img.shields.io/badge/Current%20Streak-Active-blue?style=flat-square)](https://leetcode.com/u/cargdev/)
2020

21-
- **Total Problems Solved**: 75+
21+
- **Total Problems Solved**: 79+
2222
- **Notes Written**: 1+ (expanding soon)
23-
- **Categories Covered**: Arrays, Hash Maps, Dynamic Programming, Two Pointers, Binary Search, etc.
23+
- **Categories Covered**: Arrays, Hash Maps, Dynamic Programming, Two Pointers, Binary Search, Trees, etc.
2424

2525
## 🗂 Directory Structure
2626
- `src/exercises/`: Auto-downloaded solutions via [leetcode.nvim](https://github.com/kawre/leetcode.nvim) caching
@@ -60,51 +60,53 @@ This repo tracks my journey solving LeetCode problems — not just code, but my
6060
| 29 | 089 | [Gray Code](src/exercises/89.gray-code.py) | Medium | Python |
6161
| 30 | 090 | [Subsets II](src/exercises/90.subsets-ii.py) | Medium | Python |
6262
| 31 | 091 | [Decode Ways](src/exercises/91.decode-ways.py) | Medium | Python |
63-
| 32 | 121 | [Best Time to Buy and Sell Stock](src/exercises/121.best-time-to-buy-and-sell-stock.py) | Easy | Python |
64-
| 33 | 122 | [Best Time to Buy and Sell Stock II](src/exercises/122.best-time-to-buy-and-sell-stock-ii.py) | Medium | Python |
65-
| 34 | 125 | [Valid Palindrome](src/exercises/125.valid-palindrome.py) | Easy | Python |
66-
| 35 | 128 | [Longest Consecutive Sequence](src/exercises/128.longest-consecutive-sequence.py) | Medium | Python |
67-
| 36 | 135 | [Candy](src/exercises/135.candy.py) | Hard | Python |
68-
| 37 | 141 | [Linked List Cycle](src/exercises/141.linked-list-cycle.py) | Easy | Python |
69-
| 38 | 149 | [Max Points on a Line](src/exercises/149.max-points-on-a-line.py) | Hard | Python |
70-
| 39 | 151 | [Reverse Words in a String](src/exercises/151.reverse-words-in-a-string.py) | Medium | Python |
71-
| 40 | 153 | [Find Minimum in Rotated Sorted Array](src/exercises/153.find-minimum-in-rotated-sorted-array.py) | Medium | Python |
72-
| 41 | 155 | [Min Stack](src/exercises/155.min-stack.py) | Medium | Python |
73-
| 42 | 167 | [Two Sum II - Input Array Is Sorted](src/exercises/167.two-sum-ii-input-array-is-sorted.py) | Medium | Python |
74-
| 43 | 169 | [Majority Element](src/exercises/169.majority-element.py) | Easy | Python |
75-
| 44 | 172 | [Factorial Trailing Zeroes](src/exercises/172.factorial-trailing-zeroes.py) | Medium | Python |
76-
| 45 | 189 | [Rotate Array](src/exercises/189.rotate-array.py) | Medium | Python |
77-
| 46 | 202 | [Happy Number](src/exercises/202.happy-number.py) | Easy | Python |
78-
| 47 | 205 | [Isomorphic Strings](src/exercises/205.isomorphic-strings.py) | Easy | Python |
79-
| 48 | 206 | [Reverse Linked List](src/exercises/206.reverse-linked-list.py) | Easy | Python |
80-
| 49 | 217 | [Contains Duplicate](src/exercises/217.contains-duplicate.py) | Easy | Python |
81-
| 50 | 219 | [Contains Duplicate II](src/exercises/219.contains-duplicate-ii.py) | Easy | Python |
82-
| 51 | 228 | [Summary Ranges](src/exercises/228.summary-ranges.py) | Easy | Python |
83-
| 52 | 238 | [Product of Array Except Self](src/exercises/238.product-of-array-except-self.py) | Medium | Python |
84-
| 53 | 242 | [Valid Anagram](src/exercises/242.valid-anagram.py) | Easy | Python |
85-
| 54 | 243 | [Shortest Word Distance](src/exercises/243.shortest-word-distance.py) | Easy | Python |
86-
| 55 | 244 | [Shortest Word Distance II](src/exercises/244.shortest-word-distance-ii.py) | Medium | Python |
87-
| 56 | 245 | [Shortest Word Distance III](src/exercises/245.shortest-word-distance-iii.py) | Medium | Python |
88-
| 57 | 246 | [Strobogrammatic Number](src/exercises/246.strobogrammatic-number.py) | Easy | Python |
89-
| 58 | 248 | [Strobogrammatic Number III](src/exercises/248.strobogrammatic-number-iii.py) | Hard | Python |
90-
| 59 | 271 | [Encode and Decode Strings](src/exercises/271.encode-and-decode-strings.js) | Medium | JavaScript |
91-
| 60 | 290 | [Word Pattern](src/exercises/290.word-pattern.py) | Easy | Python |
92-
| 61 | 347 | [Top K Frequent Elements](src/exercises/347.top-k-frequent-elements.js) | Medium | JavaScript |
93-
| 62 | 383 | [Ransom Note](src/exercises/383.ransom-note.py) | Easy | Python |
94-
| 63 | 392 | [Is Subsequence](src/exercises/392.is-subsequence.py) | Easy | Python |
95-
| 64 | 595 | [Big Countries](src/exercises/595.big-countries.sql) | Easy | SQL |
96-
| 65 | 704 | [Binary Search](src/exercises/704.binary-search.py) | Easy | Python |
97-
| 66 | 760 | [Find Anagram Mappings](src/exercises/760.find-anagram-mappings.py) | Easy | Python |
98-
| 67 | 875 | [Koko Eating Bananas](src/exercises/875.koko-eating-bananas.py) | Medium | Python |
99-
| 68 | 1048 | [Longest String Chain](src/exercises/1048.longest-string-chain.js) | Medium | JavaScript |
100-
| 69 | 1200 | [Minimum Absolute Difference](src/exercises/1200.minimum-absolute-difference.py) | Easy | Python |
101-
| 70 | 1302 | [Deepest Leaves Sum](src/exercises/1302.deepest-leaves-sum.py) | Medium | Python |
102-
| 71 | 2016 | [Maximum Difference Between Increasing Elements](src/exercises/2016.maximum-difference-between-increasing-elements.py) | Easy | Python |
103-
| 72 | 2053 | [Kth Distinct String in an Array](src/exercises/2053.kth-distinct-string-in-an-array.py) | Easy | Python |
104-
| 73 | 2294 | [Partition Array Such That Maximum Difference Is K](src/exercises/2294.partition-array-such-that-maximum-difference-is-k.py) | Medium | Python |
105-
| 74 | 3442 | [Maximum Difference Between Even and Odd Frequency I](src/exercises/3442.maximum-difference-between-even-and-odd-frequency-i.py) | Easy | Python |
106-
| 75 | 3582 | [Generate Tag for Video Caption](src/exercises/3582.generate-tag-for-video-caption.py) | Easy | Python |
107-
| 76 | 3583 | [Count Special Triplets](src/exercises/3583.count-special-triplets.py) | Easy | Python |
63+
| 32 | 104 | [Maximum Depth of Binary Tree](src/exercises/104.maximum-depth-of-binary-tree.py) | Easy | Python |
64+
| 33 | 121 | [Best Time to Buy and Sell Stock](src/exercises/121.best-time-to-buy-and-sell-stock.py) | Easy | Python |
65+
| 34 | 122 | [Best Time to Buy and Sell Stock II](src/exercises/122.best-time-to-buy-and-sell-stock-ii.py) | Medium | Python |
66+
| 35 | 125 | [Valid Palindrome](src/exercises/125.valid-palindrome.py) | Easy | Python |
67+
| 36 | 128 | [Longest Consecutive Sequence](src/exercises/128.longest-consecutive-sequence.py) | Medium | Python |
68+
| 37 | 135 | [Candy](src/exercises/135.candy.py) | Hard | Python |
69+
| 38 | 141 | [Linked List Cycle](src/exercises/141.linked-list-cycle.py) | Easy | Python |
70+
| 39 | 149 | [Max Points on a Line](src/exercises/149.max-points-on-a-line.py) | Hard | Python |
71+
| 40 | 151 | [Reverse Words in a String](src/exercises/151.reverse-words-in-a-string.py) | Medium | Python |
72+
| 41 | 153 | [Find Minimum in Rotated Sorted Array](src/exercises/153.find-minimum-in-rotated-sorted-array.py) | Medium | Python |
73+
| 42 | 155 | [Min Stack](src/exercises/155.min-stack.py) | Medium | Python |
74+
| 43 | 167 | [Two Sum II - Input Array Is Sorted](src/exercises/167.two-sum-ii-input-array-is-sorted.py) | Medium | Python |
75+
| 44 | 169 | [Majority Element](src/exercises/169.majority-element.py) | Easy | Python |
76+
| 45 | 172 | [Factorial Trailing Zeroes](src/exercises/172.factorial-trailing-zeroes.py) | Medium | Python |
77+
| 46 | 189 | [Rotate Array](src/exercises/189.rotate-array.py) | Medium | Python |
78+
| 47 | 202 | [Happy Number](src/exercises/202.happy-number.py) | Easy | Python |
79+
| 48 | 205 | [Isomorphic Strings](src/exercises/205.isomorphic-strings.py) | Easy | Python |
80+
| 49 | 206 | [Reverse Linked List](src/exercises/206.reverse-linked-list.py) | Easy | Python |
81+
| 50 | 217 | [Contains Duplicate](src/exercises/217.contains-duplicate.py) | Easy | Python |
82+
| 51 | 219 | [Contains Duplicate II](src/exercises/219.contains-duplicate-ii.py) | Easy | Python |
83+
| 52 | 228 | [Summary Ranges](src/exercises/228.summary-ranges.py) | Easy | Python |
84+
| 53 | 238 | [Product of Array Except Self](src/exercises/238.product-of-array-except-self.py) | Medium | Python |
85+
| 54 | 242 | [Valid Anagram](src/exercises/242.valid-anagram.py) | Easy | Python |
86+
| 55 | 243 | [Shortest Word Distance](src/exercises/243.shortest-word-distance.py) | Easy | Python |
87+
| 56 | 244 | [Shortest Word Distance II](src/exercises/244.shortest-word-distance-ii.py) | Medium | Python |
88+
| 57 | 245 | [Shortest Word Distance III](src/exercises/245.shortest-word-distance-iii.py) | Medium | Python |
89+
| 58 | 246 | [Strobogrammatic Number](src/exercises/246.strobogrammatic-number.py) | Easy | Python |
90+
| 59 | 248 | [Strobogrammatic Number III](src/exercises/248.strobogrammatic-number-iii.py) | Hard | Python |
91+
| 60 | 271 | [Encode and Decode Strings](src/exercises/271.encode-and-decode-strings.js) | Medium | JavaScript |
92+
| 61 | 274 | [H-Index](src/exercises/274.h-index.py) | Medium | Python |
93+
| 62 | 290 | [Word Pattern](src/exercises/290.word-pattern.py) | Easy | Python |
94+
| 63 | 347 | [Top K Frequent Elements](src/exercises/347.top-k-frequent-elements.js) | Medium | JavaScript |
95+
| 64 | 383 | [Ransom Note](src/exercises/383.ransom-note.py) | Easy | Python |
96+
| 65 | 392 | [Is Subsequence](src/exercises/392.is-subsequence.py) | Easy | Python |
97+
| 66 | 595 | [Big Countries](src/exercises/595.big-countries.sql) | Easy | SQL |
98+
| 67 | 704 | [Binary Search](src/exercises/704.binary-search.py) | Easy | Python |
99+
| 68 | 760 | [Find Anagram Mappings](src/exercises/760.find-anagram-mappings.py) | Easy | Python |
100+
| 69 | 875 | [Koko Eating Bananas](src/exercises/875.koko-eating-bananas.py) | Medium | Python |
101+
| 70 | 1048 | [Longest String Chain](src/exercises/1048.longest-string-chain.js) | Medium | JavaScript |
102+
| 71 | 1200 | [Minimum Absolute Difference](src/exercises/1200.minimum-absolute-difference.py) | Easy | Python |
103+
| 72 | 1302 | [Deepest Leaves Sum](src/exercises/1302.deepest-leaves-sum.py) | Medium | Python |
104+
| 73 | 2016 | [Maximum Difference Between Increasing Elements](src/exercises/2016.maximum-difference-between-increasing-elements.py) | Easy | Python |
105+
| 74 | 2053 | [Kth Distinct String in an Array](src/exercises/2053.kth-distinct-string-in-an-array.py) | Easy | Python |
106+
| 75 | 2294 | [Partition Array Such That Maximum Difference Is K](src/exercises/2294.partition-array-such-that-maximum-difference-is-k.py) | Medium | Python |
107+
| 76 | 3442 | [Maximum Difference Between Even and Odd Frequency I](src/exercises/3442.maximum-difference-between-even-and-odd-frequency-i.py) | Easy | Python |
108+
| 77 | 3582 | [Generate Tag for Video Caption](src/exercises/3582.generate-tag-for-video-caption.py) | Easy | Python |
109+
| 78 | 3583 | [Count Special Triplets](src/exercises/3583.count-special-triplets.py) | Easy | Python |
108110

109111
## 🛠️ Tools & Scripts
110112
- `create_missing_notes.sh`: Automatically creates missing note files for solved problems
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# @leet imports start
2+
from string import *
3+
from re import *
4+
from datetime import *
5+
from collections import *
6+
from heapq import *
7+
from bisect import *
8+
from copy import *
9+
from math import *
10+
from random import *
11+
from statistics import *
12+
from itertools import *
13+
from functools import *
14+
from operator import *
15+
from io import *
16+
from sys import *
17+
from json import *
18+
from builtins import *
19+
import string
20+
import re
21+
import datetime
22+
import collections
23+
import heapq
24+
import bisect
25+
import copy
26+
import math
27+
import random
28+
import statistics
29+
import itertools
30+
import functools
31+
import operator
32+
import io
33+
import sys
34+
import json
35+
from typing import *
36+
# @leet imports end
37+
38+
# @leet start
39+
# Definition for a binary tree node.
40+
# class TreeNode:
41+
# def __init__(self, val=0, left=None, right=None):
42+
# self.val = val
43+
# self.left = left
44+
# self.right = right
45+
class Solution:
46+
def maxDepth(self, root: Optional[TreeNode]) -> int:
47+
if root == None:
48+
return 0
49+
50+
def deep(r, l, c):
51+
cl = c
52+
cr = c
53+
if r:
54+
cr = deep(r.right, r.left, c + 1)
55+
if l:
56+
cl = deep(l.right, l.left, c + 1)
57+
58+
return max(cl, cr)
59+
return deep(root.right, root.left, 0) + 1
60+
61+
62+
# @leet end

src/exercises/274.h-index.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# @leet imports start
2+
from string import *
3+
from re import *
4+
from datetime import *
5+
from collections import *
6+
from heapq import *
7+
from bisect import *
8+
from copy import *
9+
from math import *
10+
from random import *
11+
from statistics import *
12+
from itertools import *
13+
from functools import *
14+
from operator import *
15+
from io import *
16+
from sys import *
17+
from json import *
18+
from builtins import *
19+
import string
20+
import re
21+
import datetime
22+
import collections
23+
import heapq
24+
import bisect
25+
import copy
26+
import math
27+
import random
28+
import statistics
29+
import itertools
30+
import functools
31+
import operator
32+
import io
33+
import sys
34+
import json
35+
from typing import *
36+
37+
# @leet imports end
38+
39+
40+
# @leet start
41+
class Solution:
42+
def hIndex(self, citations: List[int]) -> int:
43+
citations.sort()
44+
citation = len(citations)
45+
for i in range(len(citations)):
46+
if citations[i] >= citation - i:
47+
return citation - i
48+
return 0
49+
50+
51+
# @leet end

0 commit comments

Comments
 (0)