Skip to content

JessenPan/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The solution to the question in leetcode

Algorithms

This code base contains the solution to a problem whose id is less than 1000

explanation of nouns

dp : dynamic programming

bfs: breadth first search

dfs: dfs

Note:The space complexity here does not include the return value

id tag solution time complexity space complexity
1 array Java Python3 O(n)
2 linkedlist Java
3 string Java
4 divideAndConquer Java
5 dp Java
6 string Java
7 math Java
8 string Java
9 math Java
10 backtracing Java
11 backtracing Java
12 string Java O(n)
13 math Java O(n) O(1)
14 string Java O(n*n) O(1)
15 array Java
16 array Java
17 backtracing Java
19 linkedlist Java
20 stack Java
21 linked list Java O(n) O(n)
22 backtracing Java O(n) O(n)
23 linkedlist Java
24 linkedlist Java
25 linkedlist Java
26 array Java O(n) O(1)
27 array Java O(n) O(1)
28 string Java O(n*n) O(1)
29 math Java
31 array Java
32 dp Java
33 array,binarySearch Java O(logN) O(1)
34 array Java
35 binarySearch Java O(1)
36 map Java
37 backtracing Java
38 string Java
39 backtracing Java O(n)
40 backtracing Java
41 array Java
42 stack Java
43 string Java
44 backtracing Java
45 array Java
46 backtracing Java O(n)
47 backTracing Java
48 array Java
49 string Java
50 math Java
51 backtracing Java
52 backtracing Java
53 dp Java O(n) O(1)
54 array Java
55 greedy Java
56 array Java O(nlogN) O(1)
57 array Java
58 string Java O(n) O(1)
59 array Java
60 backtracing Java
61 linkedlist Java
62 dp Java
63 dp Java
64 dp Java
65 math Java
66 array Java
67 string Java O(n) O(n)
68 string Java
69 math Java O(logN) O(1)
70 dp Java
71 stack Java O(n)
72 dp Java
73 array Java
74 array Java
75 array Java
77 backtracing Java O(n)
78 backtracing Java O(n)
79 backtracing Java
80 array Java
81 array,binarySearch Java
82 linkedlist Java
83 linked list Java O(n) O(1)
84 array Java
86 linkedlist Java
88 array Java O(n*n) O(1)
89 backtracing Java O(n)
90 backtracing Java O(n)
91 dp Java
92 linkedlist Java
93 backtracing Java
94 stack Java O(n)
95 dp Java
96 dp Java
97 dp Java
98 tree Java
99 tree Java O(1) O(1)
100 tree Java O(n)
101 bfs Java O(n)
102 tree Java O(n) O(n)
103 dfs Java O(n) O(n)
104 tree Java
105 tree Java
106 tree Java O(n)
107 bfs Java
108 dfs Java O(logn)
109 dfs Java O(n)
110 tree Java O(n) O(1)
111 bfs Java O(n)
112 tree Java O(n)
113 tree Java O(n)
114 tree Java O(n) O(1)
115 dp Java
116 bfs Java O(n) O(1)
117 bfs Java O(n) O(1)
118 math Java O(n) O(1)
119 math Java O(n*n) O(n)
120 dp Java
121 dp Java O(n) O(1)
122 greedy Java
123 dp Java
124 tree Java
125 string Java O(n) O(1)
126 bfs Java
127 bfs Java
128 array Java
129 tree Java O(n) O(1)
130 dfs Java
131 backtracing Java
132 dp Java
133 graph Java
134 greedy Java
135 greedy Java
136 bit Java O(n) O(1)
137 bit Java O(n) O(1)
138 linkedlist Java O(n) O(n)
139 dp Java
140 backtracing Java
141 linkedList Java O(n) O(1)
142 linkedlist Java O(n) O(n)
143 linkedlist Java
144 stack Java O(n)
145 tree Java O(n) O(n)
146 map Java
147 linkedlist Java
148 linkedlist Java
149 math Java
150 stack Java O(n)
151 string Java
152 dp Java
153 array Java
154 array Java
155 stack Java
160 linkedlist Java O(n) O(1)
162 array Java
164 sort Java
165 string Java
166 math Java
167 map Java O(n) O(n)
168 math Java O(n) O(1)
169 array Java O(n) O(n)
171 math Java O(n) O(1)
172 math Java O(logN) O(1)
173 stack Java
179 sort Java
187 hashset Java
189 array Java O(n*n) O(1)
190 bit Java
191 bit Java O(1) O(1)
198 dp Java
199 dfs Java O(n) O(n)
200 dfs Java
201 bit Java
202 math Java O(n)
203 linked list Java O(n) O(1)
204 math Java O(n*n)
205 map Java O(n) O(n)
206 linked list Java O(n) O(n)
207 toposort Java
208 trie Java
209 array Java O(n)
210 toposort Java
211 backtracing Java
212 backtracing Java
213 dp Java
214 string Java
215 heap Java
216 backtracing Java
217 array Java O(1)
219 array Java O(n) O(n)
220 slidingwindow Java O(Nlog(N))
222 tree Java O(n) O(1)
224 stack Java
225 stack Java
226 tree,stack Java
227 string Java
228 array Java
229 array Java
230 tree Java O(n) O(1)
231 math Java O(1) O(1)
232 stack Java
233 math Java
234 linked list Java
235 tree Java O(n) O(1)
236 tree Java
237 linked list Java O(1) O(1)
238 array Java O(n)
239 heap Java
240 divideAndConquer Java
241 divideAndConquer Java
242 map Java O(n) O(1)
257 tree Java O(n)
258 math Java O(1) O(1)
260 bit Java
263 math Java O(n) O(1)
264 dp Java
268 bit Java O(n) O(1)
273 string Java
274 sort Java
275 sort Java
278 binarySearch Java
279 dp Java
282 divideAndComquer Java
283 array Java O(n) O(1)
287 Java O(n) O(1)
289 array Java
290 map Java O(n) O(n)
292 minimax Java
295 heap Java
297 tree Java
299 map Java
301 dfs Java
303 dp Java
304 dp Java
306 backtracing Java
307 segment tree Java
309 dp Java
312 dp Java
313 heap Java
315 sort Java
316 greedy Java
318 bit Java
319 math Java
322 dp Java
324 sort Java
326 math Java O(n) O(1)
327 divideAndConquer Java
328 linkedlist Java
329 backtracing Java
330 greedy Java
331 stack Java
332 tree Java
334 array Java
336 trie Java
338 bit Java O(n)
341 stack Java
342 bit Java O(1) O(1)
343 dp Java
344 string Java O(n) O(1)
345 string Java O(n) O(n)
347 heap Java
349 map Java O(n) O(n)
350 array Java O(n) O(n)
355 heap,design Java
357 backtracing Java O(n)
365 math Java
367 math Java O(1)
371 bit Java
372 math Java
373 heap Java
374 binarySearch Java O(logN) O(1)
375 dp Java
377 dp Java
378 heap Java
380 array Java
381 array Java
382 sample Java
383 string Java O(n) O(1)
384 random Java
385 stack Java
386 sort Java
387 string Java O(n) O(1)
388 string Java
389 math Java O(n) O(1)
390 math Java
392 dp Java
393 bit Java
394 stack Java
395 string Java
396 math Java
397 bit Java
398 sample Java
400 math Java
401 backtracing Java
402 greedy Java
404 tree Java O(n)
405 bit Java
406 greedy Java
407 heap Java
409 map Java O(n) O(n)
412 math Java O(n)
413 dp Java
414 array Java O(n) O(1)
415 string Java O(n) O(n)
416 dp Java
417 dfs Java
419 array Java
421 tire Java
423 math Java
424 doublepointer Java
427 array Java
429 bfs Java
430 linkedlist Java
432 design Java
433 dfs Java
434 string Java
435 greedy Java
436 binarysearch Java
437 tree Java
438 map Java
441 math Java O(1) O(1)
442 array Java
443 string Java
445 linkedlist Java
447 map Java O(n*n) O(n*n)
448 array Java O(n) O(1)
449 tree Java
450 tree Java
451 heap Java
452 greedy Java
453 math Java O(n) O(1)
454 map Java
455 greedy Java
456 stack Java
457 doublepointer Java
458 math Java
459 string Java
460 design Java
461 bit Java O(n) O(1)
462 math Java
463 array Java O(n*n) O(1)
464 minimax Java
468 string Java
470 random Java
472 trie Java
473 dfs Java
474 dp Java
475 array Java
476 bit Java O(n) O(1)
477 bit Java
478 random Java
480 slidingwindow Java
481 string Java
482 string Java
483 binarysearch Java
485 array Java O(n) O(1)
486 minimax Java
488 backtracing Java
491 dfs Java
492 math Java
493 divideAndConquer Java
494 dp Java
495 array Java
496 stack Java
497 binarysearch Java
498 array Java
500 map Java O(n) O(1)
501 tree Java O(n) O(1)
502 heap Java
503 stack Java
504 math Java
506 array Java
507 math Java O(1)
508 tree Java O(n) O(n)
509 array Java O(1)
513 dfs Java O(n) O(n)
515 dfs Java O(n) O(n)
516 dp Java
519 random Java
520 string Java O(n) O(1)
521 string Java O(1) O(1)
522 string Java
523 math Java
524 string Java
525 map Java
526 backtracing Java O(n)
528 random Java
529 bfs Java
530 math Java O(n) O(1)
532 array Java O(n) O(n)
535 math Java
537 tree Java
538 tree Java O(n) O(n)
539 string Java
540 binarysearch Java
541 string Java O(n) O(1)
542 bfs Java
543 tree Java O(n) O(1)
546 dp Java
547 dfs Java
551 string Java O(n) O(1)
553 math Java
554 map Java
556 string Java O(n) O(1)
558 tree Java
559 bfs Java
560 array Java
561 array Java O(n)
563 tree Java O(n) O(1)
564 string Java
565 array Java
566 array Java O(n*n) O(1)
567 doublepointer Java
572 tree Java
575 map Java
577 string Java O(n*n)
581 array Java O(n) O(1)
583 dp Java
589 tree Java
590 tree Java
591 stack Java
592 math Java
593 math Java
594 map Java O(n) O(n)
598 math Java O(n) O(1)
599 map Java O(n) O(n)
605 array Java O(n) O(1)
606 tree Java O(n)
609 string Java
611 array Java
617 tree Java O(logN) O(1)
621 greedy Java
622 queue Java
623 tree Java O(n)
628 math Java O(nlogn) O(1)
630 heap Java
632 heap Java
633 math Java O(n) O(1)
636 stack Java
637 tree Java
638 dp Java
640 math Java
641 queue Java
643 array Java
645 array Java O(n) O(n)
646 dp Java
647 string Java
648 trie Java
649 greedy Java
650 dp Java
652 tree Java
653 tree Java O(n)
654 tree Java O(n) O(1)
655 tree Java
657 string Java O(n)
659 greedy Java
661 array Java O(n) O(1)
662 tree Java
665 array Java
667 array Java
668 binarySearch Java
669 tree Java O(1)
670 array Java
671 tree Java O(n)
672 math Java
674 array Java O(n) O(1)
676 trie Java
677 trie Java
678 string Java
679 backtracing Java
680 string Java O(n) O(1)
682 stack Java
684 dsu Java
685 dsu Java
686 string Java
687 tree Java O(n)
690 bfs Java O(n)
691 backtracing Java
692 Java
693 bit Java O(1) O(1)
695 array Java
696 string Java O(n) O(n)
697 array Java O(n*n) O(n)
698 dfs Java
700 tree Java
701 tree Java O(n) O(1)
703 heap Java
704 binarySearch Java O(1)
705 hashset Java O(n) O(n)
706 map Java O(n) O(n)
707 linkedlist Java O(n) O(n)
709 string Java O(n) O(1)
710 random Java
712 dp Java
713 array Java
714 dp Java
717 array Java O(n) O(1)
718 dp Java
719 array Java
720 hashset Java O(n) O(n)
721 disjoinset Java
722 string Java
724 array Java O(n) O(1)
725 linkedlist Java
726 stack Java
728 math Java O(n*n) O(n)
729 array Java
733 array Java O(n) O(1)
735 stack Java
736 string Java
738 greedy Java
739 stack Java
740 dp Java
743 dfs Java
744 array Java O(n) O(1)
745 trie Java
746 dp Java
747 array Java O(n) O(1)
748 map Java
749 dfs Java
752 bfs Java
753 dfs Java
754 math Java
756 bit Java
757 greedy Java
761 string Java
762 bit Java O(n) O(1)
763 greedy Java
765 greedy Java
766 array Java O(n*m) O(1)
767 greedy Java
768 array Java
769 array Java
770 string Java
771 map Java O(n) O(n)
773 bfs Java
775 array Java
777 doublepointer Java
778 heap Java
779 recursion Java
780 backtracing Java
781 map Java
782 array Java
783 tree Java O(n) O(1)
784 backtracing Java O(n) O(1)
785 graph Java
788 math Java
789 math Java
791 string Java
792 array Java
793 binarysearch Java
794 string Java
795 array Java
797 recursion Java
799 math Java
802 dfs Java
803 dsu Java
804 string Java O(n)
805 math Java
806 math Java
807 array Java
809 string Java
810 math Java
811 map Java
812 math Java
813 dp Java
814 tree Java O(n) O(1)
815 bfs Java
816 string Java
817 linkedlist Java
819 string Java O(n) O(n)
820 string,trie Java
821 string Java
822 array Java
824 string Java
825 array Java
826 sort Java
827 dfs Java
828 doublepointer Java
829 math Java
830 array Java O(n) O(1)
831 string Java
832 array Java O(n*n) O(1)
833 string Java
835 array Java
836 math Java O(1) O(1)
839 string Java
840 array Java O(n*n) O(n)
841 dfs Java
842 backtracing Java
843 minimax Java
844 stack Java
845 doublepointer Java
846 map Java
847 bfs Java
848 string Java
849 array Java O(n) O(1)
851 dfs Java
852 array Java O(n)
856 stack Java
857 heap Java
858 math Java
859 string Java
860 greedy Java
861 greedy Java
862 queue Java
863 tree Java
864 dfs Java
865 tree Java
867 array Java
868 math Java O(n) O(1)
869 math Java
870 greedy Java
872 tree Java O(n)
874 greedy Java
875 binarysearch Java
876 linkedList Java O(n) O(1)
877 dp Java
878 math Java
880 stack Java
881 greedy Java
883 array Java O(n*n) O(n)
884 map Java O(n) O(n)
885 math Java
886 math Java
888 math Java O(n*n) O(1)
889 tree Java
890 tree Java
891 array Java
892 math Java O(n*n)
893 string Java O(n) O(n)
894 tree Java
895 stack Java
896 array Java
897 tree Java O(n)
898 bit Java
899 string Java
900 array Java
901 stack Java
903 dp Java
904 slidingwindow Java
905 array Java O(n) O(1)
906 math Java
907 stack Java
908 math Java O(n) O(1)
909 bfs Java
910 greedy Java
911 binarysearch Java
912 sort Java
914 array Java O(n)
915 array Java
916 string Java
917 string Java O(n) O(n)
919 tree Java O(n)
921 stack Java
922 array Java O(n) O(1)
923 doublepointer Java
924 dsu Java
925 string Java O(n) O(1)
926 array Java
927 math Java
928 dsu Java
929 string Java O(n) O(n)
930 doublepointer Java
931 dp Java
932 divideAndConquer Java
933 queue Java O(n) O(n)
934 bfs Java
937 string Java
938 tree Java O(n) O(1)
939 map Java
940 dp Java
941 array Java O(n) O(1)
942 math Java O(n) O(1)
944 greedy Java
945 array Java
946 stack Java
947 dsu Java
948 greedy Java
949 math Java
950 array Java
951 tree Java O(n)
952 dsu Java
953 map Java
954 array Java
955 greedy Java
957 math Java
958 tree Java
959 dsu Java
961 map Java O(n) O(n)
962 array Java
963 math Java
965 tree Java O(n)
966 string Java
969 array Java
971 tree Java
972 math Java
973 heap Java
974 array Java
976 math Java O(nlogn) O(1)
977 stack Java O(n) O(1)
979 tree Java
980 backtracing Java
981 map Java
983 dp Java
984 greedy Java
985 array Java O(n*n) O(1)
986 doublepointer Java
987 tree Java
988 tree Java O(n)
989 math Java O(n) O(1)
990 dsu Java
991 greedy Java
992 slidingwindow Java
993 bfs Java O(n)
994 bfs Java O(n*n) O(n)
995 greedy Java
996 backtracing Java
997 graph Java
998 tree Java
999 array Java O(n*n) O(1)
1002 array Java O(n*n) O(1)
1003 string Java
1004 doublepointer Java
1005 greedy Java
1006 math Java
1008 tree Java
1009 math Java O(1) O(1)
1011 array Java
1013 math Java O(n) O(1)
1014 array Java O(n) O(n)
1016 string Java
1017 math Java
1018 math Java O(n) O(1)
1019 linkedlist Java
1020 dfs Java
1021 stack Java
1022 tree Java
1023 Java
1025 dp Java
1026 tree Java
1028 tree Java
1029 greedy Java
1030 sort Java
1031 array Java
1032 trie Java
1038 tree Java O(n)
1041 math Java
1043 dp Java
1046 heap Java
1047 stack Java
1051 array Java
1052 array Java
1053 greedy Java
1072 map Java
1078 map Java O(n) O(n)
1079 backtracing Java
1089 array Java
1090 greedy Java
1094 greedy Java
1103 math Java
1104 tree Java
1105 dp Java
1106 string Java
1108 string Java
1110 dfs Java
1122 sort Java
1123 dfs Java
1137 recursion Java
1143 dp Java
1147 dp Java
1154 math Java
1155 dp Java
1160 array Java
1161 bfs Java
1169 array Java
1170 array Java
1175 math Java
1176 array Java
1184 array Java
1185 array Java
1189 map Java
1190 stack Java
1200 array Java

concurrency

id problem solution

Database

id problem solution
175 Combine Two Tables Mysql
176 Second Highest Salary Mysql
177 Nth Highes Salary Mysql
181 Employees Earning More Than Their Managers Mysql
182 Duplicate Emails Mysql
183 Submission Detail Mysql
184 Department Highest Salary Mysql
196 Delete Duplicate Emails Mysql
197 Rising Temperature Mysql

Shell

id problem solution
192 192. Word Frequency Shell
193 193. Valid Phone Numbers Shell
194 194. Transpose file Shell
195 195. Tenth Line Shell

Releases

No releases published

Packages

No packages published

Languages