Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leetcode 2O24 May #231

Open
nuoxoxo opened this issue May 2, 2024 · 1 comment
Open

Leetcode 2O24 May #231

nuoxoxo opened this issue May 2, 2024 · 1 comment

Comments

@nuoxoxo
Copy link
Owner

nuoxoxo commented May 2, 2024

  • nuoxoxo/sea#1813
@nuoxoxo
Copy link
Owner Author

nuoxoxo commented Jun 2, 2024

May

Day
31 260. Single Number III 🟡
3 ways - bitwise needs insight - sorting - set
30 1442. Count Triplets That Can Form Two Arrays of Equal XOR 🟡
Prefix xor
29 1404. Number of Steps to Reduce a Number in Binary Representation to One 🟡
Greedy
28 1208. Get Equal Substrings Within Budget 🟡
Sliding window
27 1608. Special Array With X Elements Greater Than or Equal X 🟢🟡
bisect left / lower bound
26 552. Student Attendance Record II 🔴
intersting DFS with DP-like caching
25 140. Word Break II 🔴
backtracking
24 1255. Maximum Score Words Formed by Letters 🔴
backtracking
23 2597. The Number of Beautiful Subsets 🟡🔴
backtracking
22 131. Palindrome Partitioning 🟡🔴
subsets
21 78. Subsets 🟡🔴
subsets TODO - recursively
20 1863. Sum of All Subset XOR Totals 🟢🔴
subsets bruteforced it.
19 3068. Find the Maximum Sum of Node Values 🔴
greedy
18 979. Distribute Coins in Binary Tree 🟡
Post order traversal
17 1325. Delete Leaves With a Given Value 🟡
DFS Post order traversal
16 2331. Evaluate Boolean Binary Tree 🟢🟡
BTree Recursive - DFS w/ bitwise Iterative - BFS-level dict, eval the dict
2706. Buy Two Chocolates 🆕 🟢
sort
15 2812. Find the Safest Path in a Grid 🟡
BFS twice
1022. Sum of Root To Leaf Binary Numbers 🆕 🟢
14 1219. Path with Maximum Gold 🟡
backtracking - 4-dir DFS on all none 0 nodes
797. All Paths From Source to Target 🆕 🟡
DAG backtracking Graph
13 861. Score After Flipping Matrix 🟡
Greedy DP grid - max the rows, max the cols, which are 2 diff logics
807. Max Increase to Keep City Skyline 🆕 🟡
Greedy DP - increase to min of max(R,C)
12 2373. Largest Local Values in a Matrix 🟢
grid
2578. Split With Minimum Sum 🆕 🟢
11 857. Minimum Cost to Hire K Workers 🔴
Greedy MinHeap sorting
10 786. K-th Smallest Prime Fraction 🟡🔴
- bruteforced w. Binary search
707. Design Linked List 🆕 🟡
Design
2942. Find Words Containing Character 🆕 🟢
9 3075. Maximize Happiness of Selected Children 🟡
sort pre-calc w. binary search
107. Binary Tree Level Order Traversal II 🆕 🟡
BFS
8 506. Relative Ranks 🟢
2974. Minimum Number Game 🆕 🟢
40. Combination Sum II 🆕 🟡
7 2816. Double a Number Represented as a Linked List 🟡
smart way w/ carry bruteforce 3pass w/ reverse-llist
- if val > 4 we need a new head as a carry that carries head
817. Linked List Components 🆕 🟡
set
2807. Insert Greatest Common Divisors in Linked List 🆕 🟢
rabbit leaps while inserting gcd
6 2487. Remove Nodes From Linked List 🟡
popping from Monostack reverse it and reverse it back
3136. Valid Word 🆕 🟢
5 237. Delete Node in a Linked List 🟡
1472. Design Browser History 🆕 🟡
doubly llist
4 881. Boats to Save People 🟡
2 Pointers
942. DI String Match 🆕 🟢
2570. Merge Two 2D Arrays by Summing Values 🆕 🟢
Both 2 Pointers
3 165. Compare Version Numbers 🟡
2 solns - linear time - space heavy
127. Word Ladder 🆕 🔴
BFS bruteforce
2452. Words Within Two Edits of Dictionary 🆕 🟡
hamming distance
2451. Odd String Difference 🆕 🟢
sorting
2 2441. Largest Positive Integer That Exists With Its Negative 🟢
set
2442. Count Number of Distinct Integers After Reverse Operations 🆕 🟡
set
2446. Determine if Two Events Have Conflict 🆕 🟢
comparing strings
2447. Number of Subarrays With GCD Equal to K 🆕 🟡
std::gcd - current soln is O(N^3)
1 2000. Reverse Prefix of Word 🟢
py - String[idx::-1] String.index(c)
go - bytes = make([]byte, N) - return string(bytes)
3133. Minimum Array End 🆕 🟡
use list as deque, greedy-ish logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant