@@ -550,6 +550,40 @@ impl QuestionListWidget {
550
550
IndexSet :: new ( ) ,
551
551
) ) )
552
552
}
553
+
554
+ fn process_neetcode_75_questions ( & mut self , all_questions : impl Iterator < Item = Question > ) {
555
+ let nc75slugset: HashMap < & str , usize > = HashMap :: from_iter (
556
+ NEETCODE_75
557
+ . into_iter ( )
558
+ . zip ( 0 ..75 )
559
+ . collect :: < Vec < ( & str , usize ) > > ( ) ,
560
+ ) ;
561
+
562
+ let mut nc75questions: Vec < Option < Question > > = vec ! [ None ; 75 ] ;
563
+ for question in all_questions {
564
+ let title = question
565
+ . question
566
+ . borrow ( )
567
+ . title_slug
568
+ . as_ref ( )
569
+ . unwrap ( )
570
+ . clone ( ) ;
571
+ if nc75slugset. contains_key ( & title. as_str ( ) ) {
572
+ nc75questions[ * nc75slugset. get ( title. as_str ( ) ) . unwrap ( ) ] = Some ( question. clone ( ) ) ;
573
+ }
574
+ }
575
+ self . all_questions . insert (
576
+ Rc :: new ( TopicTagModel {
577
+ id : "neetcode-75" . to_string ( ) ,
578
+ name : Some ( "Neetcode 75" . to_string ( ) ) ,
579
+ slug : Some ( "neetcode-75" . to_string ( ) ) ,
580
+ } ) ,
581
+ nc75questions
582
+ . into_iter ( )
583
+ . map ( |v| v. unwrap ( ) )
584
+ . collect :: < Vec < _ > > ( ) ,
585
+ ) ;
586
+ }
553
587
}
554
588
555
589
impl super :: Widget for QuestionListWidget {
@@ -734,6 +768,8 @@ impl super::Widget for QuestionListWidget {
734
768
} )
735
769
. collect :: < HashMap < _ , _ > > ( ) ;
736
770
771
+ let all_question_list = question_set. values ( ) . cloned ( ) ;
772
+
737
773
let map_iter = content. into_iter ( ) . map ( |v| {
738
774
(
739
775
Rc :: new ( v. 0 ) ,
@@ -742,11 +778,11 @@ impl super::Widget for QuestionListWidget {
742
778
. collect :: < Vec < _ > > ( ) ,
743
779
)
744
780
} ) ;
745
-
746
781
self . all_questions . extend ( map_iter) ;
747
782
for ql in & mut self . all_questions . values_mut ( ) {
748
783
ql. sort_unstable ( )
749
784
}
785
+ self . process_neetcode_75_questions ( all_question_list) ;
750
786
self . get_notification_queue ( )
751
787
. push_back ( Notification :: Questions ( NotifContent :: new (
752
788
WidgetName :: QuestionList ,
@@ -1023,3 +1059,81 @@ impl super::Widget for QuestionListWidget {
1023
1059
& mut self . common_state . notification_queue
1024
1060
}
1025
1061
}
1062
+
1063
+ const NEETCODE_75 : [ & str ; 75 ] = [
1064
+ "contains-duplicate" ,
1065
+ "valid-anagram" ,
1066
+ "two-sum" ,
1067
+ "group-anagrams" ,
1068
+ "top-k-frequent-elements" ,
1069
+ "product-of-array-except-self" ,
1070
+ "encode-and-decode-strings" ,
1071
+ "longest-consecutive-sequence" ,
1072
+ "valid-palindrome" ,
1073
+ "3sum" ,
1074
+ "container-with-most-water" ,
1075
+ "best-time-to-buy-and-sell-stock" ,
1076
+ "longest-substring-without-repeating-characters" ,
1077
+ "longest-repeating-character-replacement" ,
1078
+ "minimum-window-substring" ,
1079
+ "valid-parentheses" ,
1080
+ "find-minimum-in-rotated-sorted-array" ,
1081
+ "search-in-rotated-sorted-array" ,
1082
+ "reverse-linked-list" ,
1083
+ "merge-two-sorted-lists" ,
1084
+ "reorder-list" ,
1085
+ "remove-nth-node-from-end-of-list" ,
1086
+ "linked-list-cycle" ,
1087
+ "merge-k-sorted-lists" ,
1088
+ "invert-binary-tree" ,
1089
+ "maximum-depth-of-binary-tree" ,
1090
+ "same-tree" ,
1091
+ "subtree-of-another-tree" ,
1092
+ "lowest-common-ancestor-of-a-binary-search-tree" ,
1093
+ "binary-tree-level-order-traversal" ,
1094
+ "validate-binary-search-tree" ,
1095
+ "kth-smallest-element-in-a-bst" ,
1096
+ "construct-binary-tree-from-preorder-and-inorder-traversal" ,
1097
+ "binary-tree-maximum-path-sum" ,
1098
+ "serialize-and-deserialize-binary-tree" ,
1099
+ "implement-trie-prefix-tree" ,
1100
+ "design-add-and-search-words-data-structure" ,
1101
+ "word-search-ii" ,
1102
+ "find-median-from-data-stream" ,
1103
+ "combination-sum" ,
1104
+ "word-search" ,
1105
+ "number-of-islands" ,
1106
+ "clone-graph" ,
1107
+ "pacific-atlantic-water-flow" ,
1108
+ "course-schedule" ,
1109
+ "number-of-connected-components-in-an-undirected-graph" ,
1110
+ "graph-valid-tree" ,
1111
+ "alien-dictionary" ,
1112
+ "climbing-stairs" ,
1113
+ "house-robber" ,
1114
+ "house-robber-ii" ,
1115
+ "longest-palindromic-substring" ,
1116
+ "palindromic-substrings" ,
1117
+ "decode-ways" ,
1118
+ "coin-change" ,
1119
+ "maximum-product-subarray" ,
1120
+ "word-break" ,
1121
+ "longest-increasing-subsequence" ,
1122
+ "unique-paths" ,
1123
+ "longest-common-subsequence" ,
1124
+ "maximum-subarray" ,
1125
+ "jump-game" ,
1126
+ "insert-interval" ,
1127
+ "merge-intervals" ,
1128
+ "non-overlapping-intervals" ,
1129
+ "meeting-rooms" ,
1130
+ "meeting-rooms-ii" ,
1131
+ "rotate-image" ,
1132
+ "spiral-matrix" ,
1133
+ "set-matrix-zeroes" ,
1134
+ "number-of-1-bits" ,
1135
+ "counting-bits" ,
1136
+ "reverse-bits" ,
1137
+ "missing-number" ,
1138
+ "sum-of-two-integers" ,
1139
+ ] ;
0 commit comments