-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcultivation_db.yaml
More file actions
1772 lines (1595 loc) · 69 KB
/
Copy pathcultivation_db.yaml
File metadata and controls
1772 lines (1595 loc) · 69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# =============================================================================
# LeetCode Hero - Cultivation Progress Database
# =============================================================================
# This database tracks your mastery level and progress on LeetCode problems
# for technical interview preparation, particularly focused on Google-style
# algorithmic challenges.
#
# STATUS DEFINITIONS:
# -------------------
# L1_FORGOT (忘) - Problem completely forgotten, requires re-learning from scratch
# L2_STRUGGLE (解) - Can solve but with difficulty, not interview-ready yet
# L3_MASTERED (定) - Can solve within 20 minutes, bug-free, handling all edge cases
#
# FIELD DESCRIPTIONS:
# -------------------
# id: LeetCode problem number
# title: Official problem title from LeetCode
# link: Relative path to your solution folder
# leetcode-difficulty: Official difficulty (easy/medium/hard)
# topics: Algorithm/data structure tags for categorization
# status: Your current mastery level (L1_FORGOT/L2_STRUGGLE/L3_MASTERED)
# refinement_focus: Specific areas to improve or key insights to remember
#
# TOPIC TAGS:
# -----------
# Common tags include: hashtable, hashset, array, linked-list, stack, queue,
# binary-search, two-pointer, sliding-window, dp, backtracking, graph, tree,
# sorting, string, math, greedy, neetcode150
#
# ENTRY TEMPLATE:
# ---------------
# - id:
# title: ""
# link: "./"
# leetcode-difficulty:
# topics:
# status:
# refinement_focus: ""
#
# =============================================================================
problems:
- id: 1
title: "Two Sum"
link: "./problems/001_two_sum/"
leetcode-difficulty: easy
topics: [hashtable, array, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Use hashmap
[2025-12-12]: I use sorted with pair, and two pointer
[2026-04-03]: 100%.
- id: 2
title: "Add Two Numbers"
link: "./problems/002_add_two_numbers/"
leetcode-difficulty: medium
topics: [linked-list, indirect-pointer, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Indirect-pointer and sum/carry handling
[2025-12-12]: Sum/carry is correctly handled, but indirect pointer usage is incorrect. The resultHead and indirect-pointer declarations are poorly structured. Also, (*indirect) = new ListNode(val); is unclear. I incorrectly wrote indirect = &(new ListNode());
[2026-03-27]: almost correct. &(new ListNode()) still happened
- id: 3
title: "Longest Substring Without Repeating Characters"
link: "./problems/003_longest_substring_without_repeating_characters/"
leetcode-difficulty: medium
topics: [hashtable, sliding-window, string, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: 通常這種題目 While 的使用是關鍵
[2025-12-12]: re-learn using std::vector<int> last_seen(128, -1)
[2026-04-01]: 90% 10min. Structure correct. Wrong using `c - 'a'`, minus a is not needed. Also didn't come-up with the DP solution.
[2026-04-02]: 30% 10min. Fatal condition error in if.
[2026-04-03]: 70%. DP, Problem reading issue last_seen(128) not 26.
- id: 5
title: "Longest Palindromic Substring"
link: "./problems/005_longest_palindromic_substring/"
leetcode-difficulty: medium
topics: [1d-dp, iteration, dp, manachers-algorithm, string, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Expand, DP, or Manacher's algorithm
- id: 6
title: "Zigzag Conversion"
link: "./problems/006_zigzag_conversion/"
leetcode-difficulty: medium
topics: [vector, string]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Updown traverse and push to vector
- id: 7
title: "Reverse Integer"
link: "./problems/007_reverse_integer/"
leetcode-difficulty: medium
topics: [bitops, integer, signed, boundary, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: The key is boundary + minus
- id: 8
title: "String to Integer"
link: "./problems/008_string_to_integer/"
leetcode-difficulty: medium
topics: [parsing, stoi, boundary, signed, overflow]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: boundary + minus
- id: 9
title: "Palindrome Number"
link: "./problems/009_palindrome_number/"
leetcode-difficulty: easy
topics: [iteration]
status: L3_MASTERED
refinement_focus: |
[2026-01-06]: std::to_string while
[2026-01-06]: Count: 2
- id: 11
title: "Container With Most Water"
link: "./problems/011_container_with_most_water/"
leetcode-difficulty: medium
topics: [two-pointer, array, greedy, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: find the smallest of the two sides, and move the pointer
[2025-12-12]: one-shot
- id: 12
title: "Integer to Roman"
link: "./problems/012_integer_to_roman/"
leetcode-difficulty: medium
topics: [array]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Transform roman to (value, string) pair and decode greedy
- id: 13
title: "Roman to Integer"
link: "./problems/013_roman_to_integer/"
leetcode-difficulty: easy
topics: [array]
status: L2_STRUGGLE
refinement_focus: |
[2026-01-07]: Need to peek next, to know current is + or -
- id: 14
title: "Longest Common Prefix"
link: "./problems/014_longest_common_prefix/"
leetcode-difficulty: easy
topics: [array]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: The clean solution is to take the first string as golden
[2025-12-12]: misplaced inner and outer for-loop
[2026-04-11]: 100% 4min. PASSED BUT NO HIRE. bound issue.
[2026-04-12]: 100% 7min. Not passed first time. `s.substr(start, len)`
- id: 15
title: "3 Sum"
link: "./problems/015_3sum/"
leetcode-difficulty: medium
topics: [two-pointer, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Duplicates handling is tricky
- id: 16
title: "3 Sum Closest"
link: "./problems/016_3sum_closest/"
leetcode-difficulty: medium
topics: [two-pointer, array, sorting]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Same as 015_3Sum, but need to track closest value
- id: 17
title: "Letter Combinations of a Phone Number"
link: "./problems/017_letter_combinations_of_a_phone_number/"
leetcode-difficulty: medium
topics: [hashtable, backtracking, string, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Write a good helper pure function
- id: 18
title: "4 Sum"
link: "./problems/018_4sum/"
leetcode-difficulty: medium
topics: [k-sum, two-pointer, array, sorting]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: generalizing k-sum function
- id: 19
title: "Remove Nth Node From End of List"
link: "./problems/019_remove_nth_node_from_end_of_list/"
leetcode-difficulty: medium
topics: [fast-and-slow-pointer, linked-list, indirect-pointer, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Indirect-pointer and fast/slow pointer
[2026-04-13]: 30%. Removal node assiged wrong, didn't delete memory.
- id: 20
title: "Valid Parentheses"
link: "./problems/020_valid_parentheses/"
leetcode-difficulty: easy
topics: [stack, string, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: I know the stack solution, but I cannot execute it fluently and elegantly
[2026-04-06]: 90%. Typo. More to improve: use switch-stmt.
[2026-04-07]: 100% 10min.
[2026-04-14]: 100% 5min. Return value and pop() not set correctly in first shot.
- id: 21
title: "Merge Two Sorted Lists"
link: "./problems/021_merge_two_sorted_lists/"
leetcode-difficulty: easy
topics: [linked-list, indirect-pointer, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2026-03-25]: Normal dummy node is okay. But I forget indirect-pointer usage. Always use `ListNode *result;` then `ListNode **indirect = &result;`
[2026-03-25]: One-shot using indirect pointer. But a little uncertain when doing it in a sprint.
[2026-03-26]: One-shot.
- id: 22
title: "Generate Parentheses"
link: "./problems/022_generate_parentheses/"
leetcode-difficulty: medium
topics: [stack, backtracking, string, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: I know the core idea, implement has some flaws.
[2026-04-06]: 0%. Practiced.
[2026-04-07]: 100% 7min.
- id: 23
title: "Merge k Sorted Lists"
link: "./problems/023_merge_k_sorted_lists/"
leetcode-difficulty: hard
topics: [linked-list, heap, priority-queue, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Not really hard, but I need to review how to initialize a priority queue and also prevent adding nullptr to the queue. There are also one way to use merge sort to merge k lists.
[2026-04-01] 60% 13min. Structure correct. Should save ListNode* not index. Should not use default construtor for pq or nullptr will sneak in.
[2026-04-02] 50% 10min. Maybe not very focused or in good statue. `cmp` forget to `left->val`, forget adding *. A lot of minor mistakes occurs.
[2026-04-03] 100% 8min.
- id: 24
title: "Swap Nodes in Pairs"
link: "./problems/024_swap_nodes_in_pairs/"
leetcode-difficulty: medium
topics: [linked-list, indirect-pointer, recursion]
status: L2_STRUGGLE
refinement_focus: |
[2026-03-25]: While loop or helper recursion
[2026-03-26]: not fully correct
- id: 25
title: "Reverse Nodes in k-Group"
link: "./problems/025_reverse_nodes_in_k-group/"
leetcode-difficulty: hard
topics: [linked-list, indirect-pointer, recursion, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
- id: 26
title: "Remove Duplicates from Sorted Array"
link: "./problems/026_remove_duplicates_from_sorted_array/"
leetcode-difficulty: easy
topics: [array, two-pointer]
status: L2_STRUGGLE
refinement_focus: |
[2026-01-26]: Initially attempted using erase() backwards (influenced by LISP/Racket), but the two-pointer approach is the correct O(N) solution.
- id: 27
title: "Remove Element"
link: "./problems/027_remove_element/"
leetcode-difficulty: easy
topics: [array, two-pointer]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Simple, but made mistakes in return value and casting. Also learned std::remove()
- id: 28
title: "Implement strStr()"
link: "./problems/028_find_the_index_of_the_first_occurrence_in_a_string/"
leetcode-difficulty: easy
topics: [string, kmp-algorithm]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: std::string::find() and verbose explain KMP algorithm
- id: 33
title: "Search in Rotated Sorted Array"
link: "./problems/033_search_in_rotated_sorted_array/"
leetcode-difficulty: medium
topics: [binary-search, array, sorting, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]:
(1) we should check whether is left sorted or right sorted (monotonic)
(2) we should be very careful about the boundary conditions if there are only 2 elements left
[2026-04-06]: 30%. `while (l <= r)` + `<=`.
[2026-04-07]: 100% 6min.
- id: 34
title: "Find First and Last Position of Element in Sorted Array"
link: "./problems/034_find_first_and_last_position_of_element_in_sorted_array/"
leetcode-difficulty: medium
topics: [binary-search, array, sorting]
status: L2_STRUGGLE
refinement_focus:
[2025-12-12]: lower_bound and upper_bound
[2026-04-04]: 95% 10min. Using std algorithm. Learned std::distance().
- id: 35
title: "Search Insert Position"
link: "./problems/035_search_insert_position/"
leetcode-difficulty: easy
topics: [binary-search, array, sorting]
status: L3_MASTERED
refinement_focus:
[2025-12-12]: Basic lower_bound
[2026-04-04]: 100%.
- id: 36
title: "Valid Sudoku"
link: "./problems/036_valid_sudoku/"
leetcode-difficulty: medium
topics: [array, hashset, matrix, simulation, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: HashSet
- id: 42
title: "Trapping Rain Water"
link: "./problems/042_trapping_rain_water/"
leetcode-difficulty: hard
topics: [two-pointer, monotonic-stack, array, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: next-greater-element or two-pointer
- id: 48
title: "Rotate Image"
link: "./problems/048_rotate_image/"
leetcode-difficulty: medium
topics: [math-and-geometry, matrix, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Transpose + Reverse
- id: 49
title: "Group Anagrams"
link: "./problems/049_group_anagrams/"
leetcode-difficulty: medium
topics: [hashtable, string, sorting, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Sorting
[2026-04-14]: Don't think of hashmap.
- id: 53
title: "Maximum Subarray"
link: "./problems/053_maximum_subarray/"
leetcode-difficulty: medium
topics: [greedy, dp, array, neetcode150, kadane-algorithm]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: One shot Kadane's algorithm after praticing LeetCode #152.
[2026-04-11]: Re-learned.
[2026-04-14]: 100% 5min.
- id: 56
title: "Merge Intervals"
link: "./problems/056_merge_intervals/"
leetcode-difficulty: medium
topics: [intervals, array, sorting, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Sorting + Iterate and Merge
[2026-04-12]: 100%. Slightly ugly with the syntax and didn't use std::move.
- id: 57
title: "Insert Interval"
link: "./problems/057_insert_interval/"
leetcode-difficulty: medium
topics: [intervals, array, sorting, neetcode150]
status: L2_STRUGGLE
refinement_focus:
[2026-01-19]: Copy before insertion, merge overlaps, then append the rest
[2026-04-29]: 60%. Using `sel` and `inserted` to handle next insert/merge. Finally correct, but there are really a lot of edge cases to be aware.
- id: 61
title: "Rotate List"
link: "./problems/061_rotate_list/"
leetcode-difficulty: medium
topics: [linked-list, two-pointer, indirect-pointer]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Make the list circular first. There are optimizations like if k == length, do nothing
- id: 66
title: "Plus One"
link: "./problems/066_plus_one/"
leetcode-difficulty: easy
topics: [array, math-and-geometry, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: (Pass 15) But the simplest way is to use vector::insert to insert 1 at the beginning if there is a carry at the end.
- id: 70
title: "Climbing Stairs"
link: "./problems/070_climbing_stairs/"
leetcode-difficulty: easy
topics: [1d-dp, dp, math-and-geometry, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Fibonacci, bottom-up DP, top-down DP, or even math
[2026-04-11]: 100% 4min.
- id: 74
title: "Search a 2D Matrix"
link: "./problems/074_search_a_2d_matrix/"
leetcode-difficulty: medium
topics: [binary-search, matrix, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2026-04-04]: 90%. GetColRow should be {index / num_cols, index % num_cols}.
- id: 76
title: "Minimum Window Substring"
link: "./problems/076_minimum_window_substring/"
leetcode-difficulty: hard
topics: [hashtable, sliding-window, string, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Brute force but got TLE. Then used sliding window. I don't know when to use sliding window or brute force. The note is written in the #3719 solution.
[2025-12-12]: I can implement the solution using a map counter, but this is not very elegant. The best solution is to use a vector as a dictionary, plus using a total count variable to track all characters in t. Expand and shrink the window based on the total count.
[2026-04-01]: 95% 21min. Forget incr left and naming issue.
[2026-04-02]: 95% 15min. `left - right + 1`.
- id: 80
title: "Remove Duplicates from Sorted Array II"
link: "./problems/080_remove_duplicates_from_sorted_array_ii/"
leetcode-difficulty: medium
topics: [array, two-pointer]
status: L2_STRUGGLE
refinement_focus: |
[2026-01-26]: passed with duplicate count, but there are better ways to do it.
- id: 81
title: "Search in Rotated Sorted Array II"
link: "./problems/081_search_in_rotated_sorted_array_ii/"
leetcode-difficulty: medium
topics: [binary-search, array]
status: L2_STRUGGLE
refinement_focus: |
[2026-04-07]: 0%. Learning.
case compare (nums !! mid) (nums !! right) of
LT -> -- right sorted
GT -> -- left sorted
EQ -> -- right--
[2026-04-11]: 100 5min.
- id: 83
title: "Remove Duplicates from Sorted List"
link: "./problems/083_remove_duplicates_from_sorted_list/"
leetcode-difficulty: easy
topics: [linked-list, two-pointer]
status: L3_MASTERED
refinement_focus: |
[2026-04-15]: 80% 10min. Missing `continue` cause dereferce nullptr.
- id: 84
title: "Largest Rectangle in Histogram"
link: "./problems/084_largest_rectangle_in_histogram/"
leetcode-difficulty: hard
topics: [stack, array, monotonic-stack, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: (Fail 15 + 45) The key is to find the nearest smaller element on both sides for each bar. Use monotonic stack to achieve O(n) time complexity.
[2026-04-10]: 0%. Relearned.
[2026-04-11]: 30%. Wrong while using 2 pass.
- id: 91
title: "Decode Ways"
link: "./problems/091_decode_ways/"
leetcode-difficulty: medium
topics: [1d-dp, dp, string, backtracking, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: dp[i] means ways to decode s[0..i-1]. Also, we need to handle 1 digit and 2 digit separately
- id: 92
title: "Reverse Linked List II"
link: "./problems/092_reverse_linked_list_ii/"
leetcode-difficulty: medium
topics: [linked-list]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Use dummy node or indirect pointer!
- id: 94
title: "Binary Tree Inorder Traversal"
link: "./problems/094_binary_tree_inorder_traversal/"
leetcode-difficulty: easy
topics: [tree, dfs]
status: L3_MASTERED
refinement_focus:
[2026-03-26]: Just finish after #230 so it is a one shot. But I still recommend to practice more.
[2026-03-26]: one-shot using recursion
- id: 96
title: "Unique Binary Search Trees"
link: "./problems/096_unique_binary_search_trees/"
leetcode-difficulty: medium
topics: [dp, math-and-geometry]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: dp[n] means number of unique BST that can be built with n nodes. dp[n] = sum of dp[i-1]*dp[n-i] for i in [1..n]. Catalan number
- id: 98
title: "Validate Binary Search Tree"
link: "./problems/098_validate_binary_search_tree/"
leetcode-difficulty: medium
topics: [tree, dfs, binary-tree, neetcode150]
status: L1_FORGOT
refinement_focus: |
[2025-12-12]: I only validate all nodes (node->val vs node->left->val) recursively. But actually we need to pass down the valid range (min, max) from root to leaf.
- id: 100
title: "Same Tree"
link: "./problems/100_same_tree/"
leetcode-difficulty: easy
topics: [tree, dfs, bfs, neetcode150]
status: L3_MASTERED
refinement_focus:
[2026-03-26]: One-shot.
[2026-03-26]: Almost. Not checking the null pointer.
- id: 101
title: "Symmetric Tree"
link: "./problems/101_symmetric_tree/"
leetcode-difficulty: easy
topics: [tree, dfs]
status: L2_STRUGGLE
refinement_focus: |
[2026-03-26]: Almost. Arm's length Recursion (bad)
- id: 102
title: "Binary Tree Level Order Traversal"
link: "./problems/102_binary_tree_level_order_traversal/"
leetcode-difficulty: medium
topics: [tree, traversal, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Use nullptr in a queue to mark level end. But I forget to check if the current queue is empty which means we are done. So it causes infinite loop.
[2026-04-02]: 100% 10min.
- id: 104
title: "Maximum Depth of Binary Tree"
link: "./problems/104_maximum_depth_of_binary_tree/"
leetcode-difficulty: easy
topics: [tree, dfs, bfs, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]:
[2026-03-27]: one-shot.
[2026-04-15]: 100% 2min.
- id: 105
title: "Construct Binary Tree from Preorder and Inorder Traversal"
link: "./problems/105_construct_binary_tree_from_preorder_and_inorder_traversal/"
leetcode-difficulty: medium
topics: [tree, dfs, recursion, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: I know the idea, but I cannot implement it fluently. The key is to correctly manage the indices of preorder and inorder arrays. Forgot to check if the current subtree is empty (preStart > preEnd || inStart > inEnd)
- id: 110
title: "Balanced Binary Tree"
link: "./problems/110_balanced_binary_tree/"
leetcode-difficulty: easy
topics: [tree, dfs, bfs, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Reviewed the definition of balanced binary tree. Implementation is smooth, but I forgot to (add 1) when calculating height.
- id: 111
title: "Minimum Depth of Binary Tree"
link: "./problems/111_minimum_depth_of_binary_tree/"
leetcode-difficulty: easy
topics: [tree, bfs, dfs]
status: L2_STRUGGLE
refinement_focus: |
[2026-04-15]: 100% 10min. Using DFS. The optimal is BFS, and I placed wrong the swap(curr_level, next_level), should be in end of for-loop.
- id: 112
title: "Path Sum"
link: "./problems/112_path_sum/"
leetcode-difficulty: easy
topics: [tree, dfs]
status: L2_STRUGGLE
refinement_focus: |
[2026-03-26]: Check only at leaf, not nullptr.
[2026-04-17]: Passed. Noted that "leaf" means check "if (curr && !curr->left && !curr->right)"
- id: 124
title: "Binary Tree Maximum Path Sum"
link: "./problems/124_binary_tree_maximum_path_sum/"
leetcode-difficulty: hard
topics: [tree, dfs, binary-tree, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2026-01-13]: I have a clear understanding of the code structure, i.e., need a helper function that returns two values as an accumulator. There are two parts that I did not handle correctly. First, if there is only one negative value node, my base case will cause the max path to be 0. So the base case should return INT_MIN. Second, if a node has one negative child path and one positive child path, we need to discard the negative one, i.e., use std::max(0, lPathToLeaf). In sum, this needs more practice.
[2026-01-13]: basically correct, but I need to be more careful about the base case. We should return {INT_MIN, 0} instead of {0, 0}
[2026-04-21]: Didn't apply Kadane-Algorithm in root, left, right. So value is wrong.
- id: 125
title: "Valid Palindrome"
link: "./problems/125_valid_palindrome/"
leetcode-difficulty: easy
topics: [two-pointer, string, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: isalnum() and tolower()
[2026-04-03]: 50%. Not reading problem carefully & didn't add correct `l < r` check in inner while loop.
[2026-04-04]: 80%. The error is init right = 0, left = s.size() - 1. Very stupid.
[2026-04-05]: 55%. s[left] & ++left, --right.
[2026-04-06]: 100%. Good! `std::tolower(static_cast<unsigned char>(c))`
- id: 128
title: "Longest Consecutive Sequence"
link: "./problems/128_longest_consecutive_sequence/"
leetcode-difficulty: medium
topics: [hashset, array, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: sort is O(n log n), use HashSet to achieve O(n). Check only sequence starters
[2026-04-12]: 30%. I used a hashmap, but will back to O(n^2) if the sequence is not friendly.
- id: 130
title: "Surrounded Regions"
link: "./problems/130_surrounded_regions/"
leetcode-difficulty: medium
topics: [graph, dfs, array, matrix, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: one-shot.
[2026-04-06]: 100% 10min.
- id: 136
title: "Single Number"
link: "./problems/136_single_number/"
leetcode-difficulty: easy
topics: [bitops, array, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2026-03-24]: XOR
- id: 137
title: "Single Number II"
link: "./problems/137_single_number_ii/"
leetcode-difficulty: medium
topics: [bitops, array]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: two solutions. FSM (best) and bit count modulo 3 (also good)
[2026-03-29]: FSM don't understand. bit count sum not inited to zero.
- id: 138
title: "Copy List with Random Pointer"
link: "./problems/138_copy_list_with_random_pointer/"
leetcode-difficulty: medium
topics: [linked-list, hashtable, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: One-shot with HashMap.
[2025-12-12]: Did not even comprehend the problem correctly and only implemented basic deep copy.
- id: 139
title: "Word Break"
link: "./problems/139_word_break/"
leetcode-difficulty: medium
topics: [1d-dp, dp, string, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Not absolutely sure I can get this right during interview, but I know the idea. dp[i] means s[i..end] can be segmented. Need a helper function isPrefix and a recursive function with memo
- id: 141
title: "Linked List Cycle"
link: "./problems/141_linked_list_cycle/"
leetcode-difficulty: easy
topics: [linked-list, two-pointer, fast-and-slow-pointer, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2026-03-25]: I know the fast/slow pointer idea, but I cannot implement it fluently. The key is to check if fast and fast->next are nullptr directly in the while loop condition.
[2026-03-25]: One-shot
[2026-06-12]: Should check if after moving pointers, or it will be always true.
- id: 143
title: "Reorder List"
link: "./problems/143_reorder_list/"
leetcode-difficulty: medium
topics:
[linked-list, two-pointer, fast-and-slow-pointer, reverse, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2026-03-25]: I know the big picture. But failed at finding the mid node. I used `while (fast && fast->next)` which makes slow point to the second middle node in even-length list. So when merging, the first half is longer than the second half by one node, which causes problem.
[2026-03-25]: Fuck-up (1) middle point. (2) merging next missing because set to nullptr. (2) Not checking the input condition.
- id: 144
title: "Binary Tree Preorder Traversal"
link: "./problems/144_binary_tree_preorder_traversal/"
leetcode-difficulty: easy
topics: [tree, dfs]
status: L2_STRUGGLE
refinement_focus: |
[2026-03-26]: Easier than inorder or Postorder iterative solution. But I still have problems with the structure of while loop. I need to practice more.
- id: 145
title: "Binary Tree Postorder Traversal"
link: "./problems/145_binary_tree_postorder_traversal/"
leetcode-difficulty: easy
topics: [tree, dfs]
status: L2_STRUGGLE
refinement_focus: |
[2026-03-26]: This is definitely hard if you want to use iterative solution but you didn't come up the `std::reverse` trick.
[2026-03-26]: I use lambda for helper
- id: 146
title: "LRU Cache"
link: "./problems/146_lru_cache/"
leetcode-difficulty: medium
topics: [design, linked-list, hashtable, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2026-01-15]: Always practice. Use std::list + std::unordered_map. please understand why use list
[2026-02-08]: failed the second time, the reason is `iterator usage`, `splice` and reusing the last node.
[2026-02-08]: failed.
[2026-04-28]: Super hard to write vector version. The problem is detach funtion is hard to take care of prev or next is -1.
[2026-04-29]: 95% 15min. Forgot to add back to map after splice.
- id: 150
title: "Evaluate Reverse Polish Notation"
link: "./problems/150_evaluate_reverse_polish_notation/"
leetcode-difficulty: medium
topics: [stack, array, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Edge case are tricky, but the idea is straightforward. Always think when the input is invalid
- id: 152
title: "Maximum Product Subarray"
link: "./problems/152_maximum_product_subarray/"
leetcode-difficulty: medium
topics: [1d-dp, dp, array, neetcode150, kadane-algorithm]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: The dp logic is not straightforward. The key is to remember three conditions: positive, negative, zero. Using DP to find max positive and min negative
[2025-12-12]: The dp logic is smooth. The problem is the initial value of globalMax, localMax, and localMin, I didn't init it to nums[0] in the first place can cause overflow. After fixing, I use ranged based for, so index 0 is calculated twice which is not acceptable.
[2026-04-11]: 100% 12min.
- id: 153
title: "Find Minimum in Rotated Sorted Array"
link: "./problems/153_find_minimum_in_rotated_sorted_array/"
leetcode-difficulty: medium
topics: [binary-search, array, sorting, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Used `while (left <= right)` and got AC, but Gemini suggested `while (left < right)` as it is less error-prone. Learned the binary search decision-making process. Plan to redo this.
[2026-04-05]: 100% 5min.
- id: 155
title: "Min Stack"
link: "./problems/155_min_stack/"
leetcode-difficulty: medium
topics: [stack, design, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Don't understand the problem
[2025-12-12]: I know the key is to maintain two stacks, and I think through the logic, and slowly implement the code correctly. But cannot do it in a flash.
[2026-04-14]: 100% 10min. One-shot.
[2026-04-17]: 100% 5min. One-shot.
[2026-04-24]: 100% 5min. One-shot and remembered to add const to member function this time.
- id: 162
title: "Find Peak Element"
link: "./problems/162_find_peak_element/"
leetcode-difficulty: medium
topics: [binary-search, array]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Easy solution after doing LC33, LC153, LC704 in a row.
[2026-04-06]: 100% 5min.
- id: 167
title: "Two Sum II - Input Array Is Sorted"
link: "./problems/167_two_sum_ii_input_array_is_sorted/"
leetcode-difficulty: medium
topics: [two-pointer, array, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: trivial two-pointer.
[2026-04-03]: 70%. Seems trivial but fucked up left, right and 1-indexed.
[2026-04-05]: 100% 5min.
- id: 190
title: "Reverse Bits"
link: "./problems/190_reverse_bits/"
leetcode-difficulty: easy
topics: [bitops, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: I know the sequential bit manipulation. But there are two more ways that I cannot think of. Also, not familiar with `(x >> ?) | (x << x)` syntax and Immediately Invoked Function Expression.
- id: 191
title: "Number of 1 Bits"
link: "./problems/191_number_of_1_bits/"
leetcode-difficulty: easy
topics: [bitops, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: use __builtin_popcount or Brian Kernighan algorithm
[2025-04-22]: 100% 3min.
- id: 198
title: "House Robber"
link: "./problems/198_house_robber/"
leetcode-difficulty: medium
topics: [1d-dp, dp, array, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: dp[i] means max amount can be robbed from house[0..i]. dp[i] = max(dp[i-1], dp[i-2]+nums[i]). Use foldl to optimize space
[2026-04-10]: 10%. Wrong definition, wrong transition function.
[2026-04-12]: 100% 4min.
- id: 199
title: "Binary Tree Right Side View"
link: "./problems/199_binary_tree_right_side_view/"
leetcode-difficulty: medium
topics: [tree, bfs, dfs, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: Almost one shot. Only forgot to check the root node is nullptr.
- id: 200
title: "Number of Islands"
link: "./problems/200_number_of_islands/"
leetcode-difficulty: medium
topics: [graph, array, dfs, matrix, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: One-shot, but ugly. Key is `constexpr dirs[4][2]` and use `auto dfs = [&](auto &&dfs, int r, int c) -> void`.
[2026-03-29]: One-shot.
- id: 203
title: "Remove Linked List Elements"
link: "./problems/203_remove_linked_list_elements/"
leetcode-difficulty: easy
topics: [linked-list, iteration]
status: L3_MASTERED
refinement_focus: |
[2026-04-18]: 99% 3min. One shot with indirect pointer.
- id: 206
title: "Reverse Linked List"
link: "./problems/206_reverse_linked_list/"
leetcode-difficulty: easy
topics: [linked-list, iteration, recursion, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Every time I do this, I feel very frustrated. I know the idea.
- Iterative: use 3 pointers prev, curr, next. But I cannot implement correctly.
- Recursive: In Haskell, this is easy `reverse (x:xs) = (reverse xs) ++ [x]`, but I cannot implement it in C++. It is `head->next->next = head; head->next = nullptr; return newHead;`...
[2025-12-12]: I use iterative. It is almost an one-shot. Only return I should return prev instead of curr.
[2026-04-13]: 100% 2min.
- id: 207
title: "Course Schedule"
link: "./problems/207_course_schedule/"
leetcode-difficulty: medium
topics: [graph, bfs, dfs, topological-sort, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: BFS or DFS coloring to detect cycle. Or use Kahn's algorithm to do topological sort.
[2025-12-12]: I use enum-class to define colors. And get it almost right
[2026-03-27]: half correct. the states should be recusive and set Visising, recursive, Visited.
[2026-03-28]: One-shot;
- id: 209
title: "Minimum Size Subarray Sum"
link: "./problems/209_minimum_size_subarray_sum/"
leetcode-difficulty: medium
topics: [sliding-window, array]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: One-shot.
[2026-03-30]: 90% 8min. Boundary check and return value check (INT_MAX).
[2026-03-31]: 95% 6min. Didn't read the problem again. If invalid should return 0, not -1.
- id: 210
title: "Course Schedule II"
link: "./problems/210_course_schedule_ii/"
leetcode-difficulty: medium
topics: [graph, bfs, dfs, topological-sort, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: First time, now forget how to trace the path
[2025-12-12]: Second time re-learn. Khan's algorithm is easy to implement. The error I made is indeg[course] == 0, I wrote indeg[course] != 0.
[2026-03-27]: Alomost. Indegree wrong and loop detection should just check `ans.size() == numCourses`
[2026-03-28]: One-shot.
- id: 211
title: "Design Add and Search Words Data Structure"
link: "./problems/211_design_add_and_search_words_data_structure/"
leetcode-difficulty: medium
topics: [trie, backtracking, design, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: When doing first time seeing Trie, need to re-learn. The key is the struct (data)
[2025-12-12]: Second time re-learn, I found myself forgetting the important details, like using `std::unique_ptr`. Also, remember to use `auto it = map.emplace(...).first`. Emplace returns a pair<iterator, bool>. We can add (void) infront of emplace if we don't care about the return value.
- id: 213
title: "House Robber II"
link: "./problems/213_house_robber_ii/"
leetcode-difficulty: medium
topics: [1d-dp, dp, circular, array, neetcode150]
status: L2_STRUGGLE
refinement_focus: |
[2025-12-12]: Arranged in circle. Two cases: rob house[0..n-2] or house[1..n-1]
- id: 215
title: "Kth Largest Element in an Array"
link: "./problems/215_kth_largest_element_in_an_array/"
leetcode-difficulty: medium
topics: [heap, array, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2026-01-23]: One-shot.
- id: 217
title: "Contains Duplicate"
link: "./problems/217_contains_duplicate/"
leetcode-difficulty: easy
topics: [hashset, array, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2025-12-12]: HashSet
[2026-04-15]: 100% 3min.
- id: 219
title: "Contains Duplicate II"
link: "./problems/219_contains_duplicate_ii/"
leetcode-difficulty: easy
topics: [hashset, array, sliding-window, dp]
status: L3_MASTERED
refinement_focus: |
[2026-04-02] 80% 8min. Range issue & `++left` But real solution should use DP.
- id: 220
title: "Contains Duplicate III"
link: "./problems/220_contains_duplicate_iii/"
leetcode-difficulty: hard
topics: [hashset, array, sliding-window, binary-search]
status: L1_FORGOT
refinement_focus: |
[2026-04-03] Failed.
[2026-04-11] 0% 20min. Know lower_bound. We only check indexDiff from past.
- id: 222
title: "Count Complete Tree Nodes"
link: "./problems/222_count_complete_tree_nodes/"
leetcode-difficulty: medium
topics: [tree, binary-search, dfs]
status: L3_MASTERED
refinement_focus: |
[2026-04-07] 0%. Just learned the trick. Go to left most and right most to find the height.
[2026-04-10] 100% 5min.
- id: 226
title: "Invert Binary Tree"
link: "./problems/226_invert_binary_tree/"
leetcode-difficulty: easy
topics: [tree, dfs, bfs, neetcode150]
status: L3_MASTERED
refinement_focus: |
[2026-03-26]: One-shot.
[2026-03-26]: One-shot.