Skip to content

A set of coding questions and solutions in Java/C++. Platforms used - GeeksforGeeks, Hackerrank, Leetcode, Codeforces. README file is updated with one execution of https://github.com/prateekshyap/DSA/blob/main/UpdateReadme.java

Notifications You must be signed in to change notification settings

prateekshyap/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Topicwise-Solutions-To-Coding-Questions

Solutions to the algorithmic problems in LeetCode, GeeksForGeeks, Hackerrank, Interviewbit and Codeforces written in C++ and JAVA

What you can find in this repository

We have solved quite a number of problems from several topics. See the below table for further details.

How to contribute?

  1. Fork the repository
  2. Do the desired changes (add/delete/modify)
  3. Make a pull request

If you want to update the readme file as well, you have to install Java and Jsoup. Then you can run the UpdateReadme.java file to update the readme file.

When to contribute?

  1. If there is no solution to a problem in the main branch
  2. If your solution is asymptotically faster than the one in the main branch
  3. If your algorithm is of the same time complexity but with reduced code size (In this case, comment out the original solution and make a pull request with your solution.)
  4. If you have another method of solving the problem which is asymptotically slower than the original method (In this case, comment your solution in the main file and make a pull request.)
  5. If you want to update the UpdateReadme.java file

Format for solution files

  1. Paste the link for the question within comments.
  2. Paste the solution.
  3. Save with proper extension name.

Description of auto-updation of Readme file

UpdateReadme.java is the main file. It reads information (that are obtained online) from OnlineInfo.csv file. If you have updated the readme file with some online information without adding into csv file, then you need to run OnlineToCSV.java file to read that from readme and store in the csv file.

For difficulty level, csv file is already updated. For other online information columns you'll have to update it.

Algorithms

Number of Problems Solved (21-May-2023 11:22:31)

Topic Name Java CPP Python
Arrays 123 75 0
BackTracking 35 16 0
Bit-Magic 32 23 0
Codeforces 76 1 0
Concurrency 6 0 0
Disjoint-Set 6 1 0
Dynamic-Programming 173 87 2
Graph 93 50 1
Greedy 60 19 0
Hashing 75 23 0
Heap 35 13 0
Linked-List 67 42 0
Matrix 56 27 0
Miscellaneous 135 12 0
Queue 12 6 0
Recursion 14 13 0
Searching 55 36 0
Segment-Tree 4 0 0
Sorting 19 7 0
Stack 33 18 1
Strings 118 47 0
Tree 177 88 0
Trie 18 13 0
Total 1422 617 4

Reference

Arrays

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Rearrange Array Alternately 1587115620 GFG Java Medium O(n)
2 3sum With Multiplicity LC Java O(n2)
3 Arithmetic Sequences BS CPP Java O(n2)
4 Bulk Shift Letters BS CPP O(1)
5 Compressed Vector Product BS CPP O(1)
6 Dropped Sensor Metric BS CPP O(1)
7 K Distinct Window BS Java O(n)
8 Largest Sublist Sum BS LC GFG CPP Java Medium O(1)
9 Largest And Smallest Difference BS Java O(n)
10 Majority Vote BS LC Java O(n)
11 Maximum Absolute Value Of Sublist BS LC CPP Java O(1)
12 Number Of K Length Sublists With Average At Least Target BS Java O(n)
13 Rain Catcher BS LC Java O(n)
14 Remove Duplicates Occurring More Than Twice BS LC CPP Java O(1)
15 Set Split BS Java O(n2)
16 Split String With Same Distinct Counts BS LC Java O(n)
17 Submajority Vote BS LC Java O(n)
18 XOR Range Queries BS Java O(n)
19 Array Of Alternate Ve And Ve Nos1401 GFG CPP Java Easy O(n2)
20 Bag Of Tokens LC Java O(n)
21 Best Time To Buy And Sell Stock LC CPP O(1)
22 Best Time To Buy And Sell Stock Ii LC GFG Java Medium O(n)
23 Binary Subarrays With Sum LC Java O(n)
24 Boats To Save People LC Java O(n)
25 Brick Wall LC Java O(n2)
26 Chocolate Distribution Problem3825 GFG Java Easy O(n)
27 Common Elements1132 GFG CPP Java Easy O(n)
28 Contiguous Array LC CPP Java O(n)
29 Count Number Of Bad Pairs LC CPP O(1)
30 Count Number Of Nice Subarrays LC Java O(n)
31 Count Pairs With Given Sum5022 GFG Java Easy O(n)
32 Count Smaller Elements2214 GFG Java null O(n)
33 Count Subarrays With Equal Number Of 1s And 0s 1587115620 GFG CPP Java Medium O(1)
34 Count Subarrays With Score Less Than K LC Java O(n2)
35 Count The Subarrays Having Product Less Than K1708 GFG Java Hard O(n2)
36 Crush HR Java O(n)
37 Cyclically Rotate An Array By One2614 GFG CPP Java Basic O(1)
38 Distinct Absolute Array Elements4529 GFG CPP Java Easy O(n2)
39 Factorials Of Large Numbers2508 GFG CPP Java Medium O(1)
40 Find All Good Indices LC Java O(n)
41 Find Good Days To Rob The Bank LC Java O(n)
42 Find In Mountain Array LC Java O(n)
43 Find Missing Observations LC CPP Java O(n)
44 Find Pivot Index LC GFG CPP Java Easy O(n)
45 Find Target Indices After Sorting Array LC Java O(n)
46 Find The Duplicate Number LC CPP Java O(n)
47 Fruit Into Baskets LC Java O(n2)
48 Greatest English Letter In Upper And Lower Case LC CPP O(n2)
49 Insert Interval LC CPP Java O(n)
50 Intersection Of Two Arrays Ii LC LC GFG CPP Java Easy O(1)
51 Interval List Intersections LC Java O(n)
52 Inversion Of Array 1587115620 GFG Java Medium O(n)
53 Jump Game GFG Java Medium O(n)
54 K Divisible Elements Subarrays LC Java O(n)
55 Kth Smallest Element5635 GFG CPP Java Medium O(1)
56 Large Factorial4721 GFG CPP Java Medium O(1)
57 Largest Number Formed From An Array1117 GFG Java Medium O(n)
58 Leaders In An Array 1587115620 GFG CPP Java Easy O(1)
59 Longest Consecutive Sequence LC GFG CPP Java Medium O(1)
60 Longest Continuous Subarray With Absolute Diff Less Than Or Equal To Limit LC Java O(n2)
61 Longest Mountain In Array LC Java O(n2)
62 Longest Nice Subarray LC Java O(n2)
63 Longest Subarray Of 1s After Deleting One Element LC Java O(n2)
64 Majority Element LC GFG CPP Medium O(1)
65 Majority Element Ii LC CPP O(1)
66 Make Array Zero By Subtracting Equal Amounts LC CPP O(1)
67 Max Circular Subarray Sum 1587115620 GFG Java Hard O(n2)
68 Max Consecutive Ones Iii LC GFG CPP Java Medium O(1)
69 Max Distance Between Same Elements GFG Java Easy O(n)
70 Max Sum Of A Pair With Equal Sum Of Digits LC CPP O(1)
71 Max Sum Subarray Of Size K5313 GFG CPP Java Basic O(1)
72 Maximum Ascending Subarray Sum LC Java O(n)
73 Maximum Difference Of Zeros And Ones In Binary String4111 GFG CPP Java Easy O(1)
74 Maximum Erasure Value LC Java O(n2)
75 Maximum Index 1587115620 GFG Java Medium O(n2)
76 Maximum Intervals Overlap5708 GFG Java null O(n)
77 Maximum Number Of Pairs In Array LC CPP O(1)
78 Maximum Points You Can Obtain From Cards LC CPP O(1)
79 Maximum Product Subarray LC GFG CPP Java Medium O(1)
80 Maximum Product Subset Of An Array GFG Java Medium O(n)
81 Median Of Two Sorted Arrays LC GFG Java Hard O(n)
82 Merge Intervals LC GFG CPP Java Medium O(1)
83 Merge Similar Items LC CPP O(1)
84 Merge Two Sorted Arrays5135 GFG CPP Java Hard O(1)
85 Minimize Maximum Of Array LC Java O(n)
86 Minimize Maximum Pair Sum In Array LC Java O(n2)
87 Minimize The Heights3351 GFG Java Medium O(n)
88 Minimum Number Of Jumps 1587115620 GFG Java Medium O(n)
89 Minimum Size Subarray Sum LC CPP Java O(1)
90 Move All Negative Elements To End1813 GFG CPP Java Easy O(1)
91 Move Zeroes LC CPP Java O(1)
92 Next Higher Palindromic Number Using The Same Set Of Digits5859 GFG CPP Java Medium O(1)
93 Next Permutation LC CPP Java O(1)
94 Non Decreasing Array LC Java O(n)
95 Number Of Arithmetic Triplets LC CPP O(1)
96 Number Of Good Ways To Split A String LC CPP O(1)
97 Number Of Sub Arrays Of Size K And Average Greater Than Or Equal To Threshold LC CPP Java O(1)
98 Number Of Subsequences That Satisfy The Given Sum Condition LC Java O(n)
99 Number Of Zero Filled Subarrays LC CPP Java O(1)
100 Pairs Of Songs With Total Durations Divisible By 60 LC Java O(n)
101 Palindrome String0817 GFG Java Easy O(1)
102 Partition Array Into Three Parts With Equal Sum LC CPP Java O(1)
103 Partition Array Such That Maximum Difference Is K LC Java O(n)
104 Partitions IB Java O(n2)
105 Pick From Both Sides IB Java O(n)
106 Plus One GFG CPP Java Easy O(n)
107 Product Of Array Except Self LC GFG Java null O(1)
108 Product Of The Last K Numbers LC Java O(n)
109 Push Dominoes LC Java O(n2)
110 Rearrange An Array With O1 Extra Space3142 GFG Java Medium O(n2)
111 Remove Duplicates From Sorted Array LC CPP Java O(1)
112 Remove One Element To Make The Array Strictly Increasing LC CPP O(1)
113 Replace Elements With Greatest Element On Right Side LC CPP Java O(1)
114 Reverse An Array GFG CPP Java School O(1)
115 Rotate And Delete 1587115621 GFG Java Medium O(n)
116 Rotate Array LC CPP Java O(1)
117 Shortest Subarray With Sum At Least K LC CPP Java O(1)
118 Shortest Unsorted Continuous Subarray LC CPP Java O(1)
119 Smallest Subarray With Sum Greater Than X5651 GFG CPP Java null O(1)
120 Smallest Subset With Greater Sum GFG Java Easy O(n)
121 Smallest Sum Contiguous Subarray GFG Java Medium O(n)
122 Sort An Array Of 0s 1s And 2s4231 GFG CPP Java Easy O(1)
123 Sort Colors LC CPP Java O(1)
124 Stickler Theif 1587115621 GFG CPP Easy O(1)
125 Stock Buy And Sell 1587115621 GFG CPP Medium O(1)
126 Subarray Product Less Than K LC GFG CPP Hard O(1)
127 Subarray Sum Equals K LC CPP Java O(1)
128 Subarray With 0 Sum 1587115621 GFG CPP Java Easy O(1)
129 Subarray With Given Sum 1587115621 GFG CPP Java Easy O(1)
130 Subarrays With K Different Integers LC Java O(n)
131 Sum Of Absolute Differences In A Sorted Array LC Java O(n)
132 Sum Of All Odd Length Subarrays LC Java O(n2)
133 Sum Of Middle Elements Of Two Sorted Arrays2305 GFG Java Medium O(n)
134 Summary Ranges LC Java O(n)
135 Three Way Partitioning GFG CPP Java Easy O(1)
136 Trapping Rain Water LC CPP O(1)
137 Triplet Sum In Array 1587115621 GFG CPP Medium O(1)
138 Union Of Two Arrays3538 GFG CPP Java Basic O(1)
139 Union Of Two Sorted Arrays GFG CPP Java Easy O(1)
140 Unique Morse Code Words LC CPP O(1)
141 Valid Triangle Number LC Java O(n3)
142 Wave Array 1587115621 GFG Java Easy O(n)
143 Ways To Make A Fair Array LC Java O(n)
144 Zero Sum Subarrays1825 GFG CPP Java Medium O(1)

BackTracking

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Additive Number LC Java O(n)
2 All Unique Permutations Of An Array GFG Java Medium O(n2)
3 Binary Watch LC Java O(1)
4 Combination Sum LC GFG CPP Java Medium O(n)
5 Combination Sum Ii LC CPP Java O(n)
6 Combination Sum Iii LC CPP Java O(n)
7 Combination Sum Iv LC CPP Java O(n)
8 Count Number Of Maximum Bitwise Or Subsets LC Java O(n)
9 Design Add And Search Words Data Structure LC Java O(n2)
10 Fair Distribution Of Cookies LC Java O(n)
11 Find Whether Path Exist5238 GFG Java Medium O(n2)
12 Generate Parentheses LC CPP Java O(n)
13 Largest Number In K Swaps 1587115620 GFG Java Medium O(n2)
14 Minimum Genetic Mutation LC Java O(n3)
15 N Queens LC Java O(n2)
16 Non Decreasing Subsequences LC Java O(n)
17 Number Of Paths0926 GFG CPP Java Easy O(1)
18 Numbers With Same Consecutive Differences LC Java O(n2)
19 Palindrome Partitioning LC GFG Java Hard O(n)
20 Palindrome Partitioning Ii LC Java O(n)
21 Partition A Set Into Two Subsets Such That The Difference Of Subset Sums Is Minimum Set 2 GFG Java Hard O(1)
22 Partition Array To K Subsets GFG Java Hard O(n)
23 Permutations LC GFG CPP Java Easy O(1)
24 Permutations Ii LC CPP Java O(n)
25 Rat In A Maze Problem GFG CPP Java Medium O(1)
26 Remove Invalid Parentheses LC Java O(n)
27 Restore Ip Addresses LC GFG CPP Medium O(1)
28 Split Array Into Fibonacci Sequence LC Java O(n)
29 Subset Sums Between The Given Range GFG Java Hard O(n2)
30 Sudoku Solver LC GFG CPP Java Hard O(1)
31 Sum Of All Subset Xor Totals LC Java O(1)
32 Travelling Salesman Problem2732 GFG Java Hard O(n)
33 Unique Paths Iii LC CPP O(1)
34 Word Break Ii LC GFG CPP Java Hard O(1)
35 Word Ladder Ii LC GFG CPP Java null O(1)
36 Word Search LC CPP Java O(1)
37 Word Search Ii LC CPP Java O(1)

Bit-Magic

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Longest Consecutive Run Of 1s In Binary BS GFG CPP Java Easy O(1)
2 Minimum Updates To Make Bitwise OR Equal To Target BS CPP Java O(1)
3 Add Binary LC CPP Java O(n)
4 Bit Difference 1587115620 GFG CPP Java Basic O(n)
5 Bitwise Xor Of All Pairings LC Java O(n)
6 Check Whether K Th Bit Is Set Or Not 1587115620 GFG CPP Java Easy O(n)
7 Count Total Set Bits 1587115620 GFG CPP Java Medium O(n)
8 Find Position Of Set Bit3706 GFG CPP Java Basic O(1)
9 Find The Original Array Of Prefix Xor LC Java O(n)
10 Finding The Numbers0215 GFG Java Easy O(n)
11 Geek And Function V GFG Java Easy O(n2)
12 Jump Game GFG CPP Medium O(1)
13 Largest Combination With Bitwise And Greater Than Zero LC Java O(n2)
14 Maximum Subset Xor GFG Java Hard O(n2)
15 Maximum Xor After Operations LC Java O(n)
16 Minimize Xor LC Java O(n)
17 Missing Number In Array1416 GFG CPP Java Easy O(n2)
18 Nth Natural Number GFG CPP Java Hard O(1)
19 Number Of 1 Bits LC CPP Java O(1)
20 Number Of Excellent Pairs LC Java O(n)
21 Parallel Courses Ii LC CPP O(1)
22 Permutation Sequence LC CPP Java O(n)
23 Power Of Two LC CPP Java O(1)
24 Reverse Bits LC GFG CPP Java Easy O(1)
25 Single Number LC CPP Java O(n)
26 Single Number Iii LC CPP Java O(1)
27 Sort By Set Bit Count1153 GFG Java Easy O(n)
28 Sum Of Two Integers LC CPP Java O(1)
29 Sum Of Two Numbers Without Using Arithmetic Operators GFG CPP Java Easy O(1)
30 Trailing Zeroes In Factorial5134 GFG CPP Java Easy O(1)
31 Ugly Number LC CPP Java O(1)
32 Ugly Number Ii LC CPP Java O(1)
33 X Xor A Is Minimum And Set Bits In X B GFG Java Hard O(n)

Codeforces

# Title Links Solution Difficulty Time Complexity Space Complexity
1 112 A CF Java O(n)
2 1141 B CF Java O(n)
3 1144 B CF Java O(n)
4 115 A CF Java O(n)
5 1208 A CF Java O(n)
6 1283 A CF Java O(n)
7 129 A CF Java O(n)
8 1294 A CF Java O(n)
9 1296 B CF Java O(n2)
10 1311 A CF Java O(n)
11 1324 A CF Java O(n2)
12 1325 B CF Java O(n2)
13 1326 B CF Java O(n)
14 1335 B CF Java O(n2)
15 1337 B CF Java O(n2)
16 1343 B CF Java O(n2)
17 1350 A CF Java O(n2)
18 1353 B CF Java O(n2)
19 1367 B CF Java O(n2)
20 1368 A CF Java O(n2)
21 1370 A CF CPP Java O(1)
22 1374 B CF Java O(n)
23 1385 B CF Java O(n2)
24 1401 A CF Java O(n)
25 141 A CF Java O(n)
26 1426 B CF Java O(n4)
27 1430 A CF Java O(n)
28 1462 C CF Java O(n2)
29 1475 B CF Java O(n)
30 148 A CF Java O(n)
31 1525 B CF Java O(n2)
32 1543 B CF Java O(n2)
33 1559 B CF Java O(n2)
34 1560 B CF Java O(n)
35 158 A CF Java O(1)
36 1607 H CF Java O(n2)
37 1624 B CF Java O(n)
38 200 B CF Java O(n)
39 231 A CF Java O(n)
40 236 A CF Java O(n)
41 263 A CF Java O(n2)
42 266 B CF Java O(n2)
43 282 A CF Java O(n)
44 318 A CF Java O(1)
45 32 B CF Java O(n)
46 320 A CF Java O(n)
47 339 A CF Java O(n)
48 34 B CF Java O(n)
49 4 A CF Java O(1)
50 41 A CF Java O(n)
51 432 A CF Java O(n)
52 439 A CF Java O(n)
53 443 A CF Java O(n)
54 469 A CF Java O(n)
55 474 A CF Java O(n)
56 490 A CF Java O(n)
57 496 A CF Java O(n)
58 50 A CF Java O(1)
59 546 A CF Java O(1)
60 580 A CF Java O(n)
61 59 A CF Java O(n)
62 617 A CF Java O(1)
63 677 A CF Java O(n)
64 702 A CF Java O(n)
65 709 A CF Java O(n)
66 71 A CF Java O(n)
67 711 A CF Java O(n)
68 732 A CF Java O(1)
69 746 B CF Java O(n)
70 749 A CF Java O(n)
71 750 A CF Java O(n)
72 768 A CF Java O(n)
73 977 B CF Java O(n)
74 978 B CF Java O(n)
75 991 B CF Java O(n)
76 999 B CF Java O(n)

Concurrency

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Building H2o LC Java O(1)
2 Fizz Buzz Multithreaded LC Java O(n)
3 Print Foobar Alternately LC Java O(n)
4 Print In Order LC Java O(1)
5 Print Zero Even Odd LC Java O(n)
6 The Dining Philosophers LC Java O(n)

Disjoint-Set

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Accounts Merge LC Java O(n)
2 Lexicographically Smallest Equivalent String LC Java O(n)
3 Number Of Operations To Make Network Connected LC Java O(n)
4 Number Of Provinces LC GFG Java Medium O(n3)
5 Redundant Connection LC Java O(n)
6 Satisfiability Of Equality Equations LC Java O(n)
7 Union Find GFG CPP null O(1)

Dynamic-Programming

# Title Links Solution Difficulty Time Complexity Space Complexity
1 0 1 Knapsack Problem0945 GFG CPP Java Medium O(n2)
2 Collecting Coins BS Java O(n)
3 Count Square Submatrices BS Java O(n2)
4 Delete Characters To Equalize Strings BS Java O(n2)
5 Equal Partitions BS LC Java O(n)
6 Largest Sum Of Non Adjacent Numbers BS CPP Java O(1)
7 Longest Bitonic Subsequence BS Java O(n2)
8 Longest Common Substring BS GFG CPP Java Medium O(1)
9 Longest Increasing Subsequence BS GFG Java Medium O(n2)
10 Longest Palindromic Substring BS CPP O(1)
11 Longest Sign Alternating Subsequence BS LC GFG CPP Java Medium O(1)
12 Minimum Dropping Path Sum BS LC CPP Java O(1)
13 Multiset Sum BS CPP Java O(1)
14 Palindrome Splitting BS LC CPP Java O(1)
15 Rod Cutting BS Java O(n)
16 Skip Tasks To Minimize Work BS CPP Java O(1)
17 XOR Range Queries BS CPP O(1)
18 All Possible Full Binary Trees LC Java O(n2)
19 Arithmetic Slices LC CPP Java O(n2)
20 Arithmetic Slices Ii Subsequence LC CPP Java O(n2)
21 Bbt Counter4914 GFG CPP Java Easy O(n)
22 Beautiful Arrangement LC Java O(n)
23 Best Time To Buy And Sell Stock Iv LC GFG Java Hard O(n2)
24 Best Time To Buy And Sell Stock With Cooldown LC Java O(n)
25 Best Time To Buy And Sell Stock With Transaction Fee LC Java O(n)
26 Binary Trees With Factors LC CPP Java O(n)
27 Box Stacking GFG Java Medium O(n2)
28 Brackets In Matrix Chain Multiplication1024 GFG CPP Java Hard O(n)
29 Burst Balloons LC Java O(n)
30 Check If There Is A Valid Partition For The Array LC CPP Java O(n)
31 Cherry Pickup Ii LC Java O(n5)
32 Climbing Stairs LC GFG Java Medium O(n)
33 Coin Change LC GFG CPP Java Medium O(n2)
34 Coin Change 2 LC CPP Java O(n)
35 Count Different Palindromic Subsequences LC CPP O(1)
36 Count Digit Groupings Of A Number1520 GFG CPP Java Medium O(n)
37 Count Number Of Teams LC Java O(n3)
38 Count Number Of Ways To Place Houses LC Java O(n)
39 Count Numbers With Unique Digits LC Java O(n2)
40 Count Of Ap Subsequences0016 GFG CPP Java null O(n2)
41 Count Palindromic Subsequences GFG CPP Java Medium O(n2)
42 Count Primes LC Java O(n2)
43 Count Sorted Vowel Strings LC Java O(n2)
44 Count Special Integers LC Java O(n)
45 Count Square Submatrices With All Ones LC CPP Java O(n2)
46 Count Unique Characters Of All Substrings Of A Given String [LC](Ref : https://leetcode.com/problems/count-unique-characters-of-all-substrings-of-a-given-string/discuss/128952/JavaC%2B%2BPython-One-pass-O(N)) LC CPP O(1)
47 Count Vowels Permutation LC CPP Java O(n)
48 Counting Bits LC CPP Java O(n2)
49 Cutted Segments1642 GFG CPP Java Medium O(1)
50 Decode Ways LC CPP Java O(n)
51 Decode Ways Ii LC CPP Java O(n)
52 Delete And Earn LC Java O(n)
53 Dice Roll Simulation LC Java O(n)
54 Different Ways To Add Parentheses LC Java O(n3)
55 Distinct Subsequences LC CPP Java O(n)
56 Domino And Tromino Tiling LC Java O(n)
57 Dungeon Game LC Java O(n2)
58 Edit Distance LC GFG CPP Java Medium O(n2)
59 Egg Drop With 2 Eggs And N Floors LC CPP O(1)
60 Find All Duplicates In An Array LC CPP O(1)
61 Find Two Non Overlapping Sub Arrays Each With Target Sum LC Java O(n2)
62 Freedom Trail LC Java O(n)
63 Friends Pairing Problem5425 GFG CPP Java Easy O(n)
64 Get Maximum In Generated Array LC Java O(n)
65 Get Minimum Squares0538 GFG CPP Java Medium O(1)
66 Gold Mine Problem2608 GFG CPP Java Easy O(1)
67 Greatest Sum Divisible By Three LC Java O(n)
68 House Robber LC CPP Java O(n)
69 House Robber Ii LC CPP Java O(n)
70 House Robber Iii LC GFG CPP Java Medium O(1)
71 Integer Break LC Java O(n2)
72 Integer Replacement LC Java O(n)
73 Interleaving String LC Java O(n2)
74 Intersecting Intervals GFG Java Hard O(n)
75 Is Subsequence LC Java O(n)
76 Jump Game Ii LC Java O(n2)
77 Jump Game V LC Java O(n)
78 K Palindrome GFG Java Easy O(n2)
79 Knapsack With Duplicate Items4201 GFG CPP Java Easy O(1)
80 Knight Dialer LC Java O(n)
81 Knight Probability In Chessboard LC Java O(n)
82 Largest Divisible Subset LC CPP Java O(n2)
83 Largest Sum Of Averages LC Java O(n)
84 Last Stone Weight Ii LC Java O(n)
85 Lcs Of Three Strings0028 GFG CPP Java Medium O(1)
86 Longest Arithmetic Subsequence LC Java O(n2)
87 Longest Arithmetic Subsequence Of Given Difference LC Java O(n)
88 Longest Common Subsequence LC GFG CPP Java Medium O(n3)
89 Longest Common Subsequence 1587115620 GFG CPP Medium O(1)
90 Longest Continuous Increasing Subsequence LC CPP Java O(1)
91 Longest Ideal Subsequence LC CPP Java O(1)
92 Longest Increasing Path In A Matrix LC Java O(n)
93 Longest Increasing Subsequence LC CPP O(1)
94 Longest Increasing Subsequence 1587115620 GFG CPP Medium O(1)
95 Longest Palindromic Subsequence LC GFG CPP Java Python Medium O(1)
96 Longest Palindromic Substring LC Java O(n2)
97 Longest Repeating Subsequence2004 GFG CPP Java Easy O(1)
98 Longest String Chain LC CPP O(1)
99 Longest Turbulent Subarray LC Java O(n)
100 Matrix Block Sum LC Java O(n)
101 Matrix Chain Multiplication0303 GFG CPP Java Hard O(1)
102 Max Sum Of Rectangle No Larger Than K LC Java O(n2)
103 Maximal Square LC GFG CPP Java Medium O(1)
104 Maximum Height By Stacking Cuboids LC Java O(n2)
105 Maximum Length Of Pair Chain LC CPP Java O(1)
106 Maximum Length Of Repeated Subarray LC CPP Java O(1)
107 Maximum Number Of Events That Can Be Attended Ii LC Java O(n)
108 Maximum Profit In Job Scheduling LC Java O(n2)
109 Maximum Score From Performing Multiplication Operations LC Java O(n2)
110 Maximum Score Words Formed By Letters LC Java O(n2)
111 Maximum Sum Increasing Subsequence4749 GFG Java Medium O(n2)
112 Maximum Sum Of Elements Not Part Of Lis GFG Java Medium O(n)
113 Min Cost Climbing Stairs LC CPP Java O(1)
114 Minimize The Difference Between Target And Chosen Elements LC Java O(n3)
115 Minimum Ascii Delete Sum For Two Strings LC Java O(n2)
116 Minimum Cost For Tickets LC CPP Java O(1)
117 Minimum Cost To Fill Given Weight In A Bag1956 GFG CPP Java Medium O(n2)
118 Minimum Cost Tree From Leaf Values LC Java O(n)
119 Minimum Falling Path Sum LC CPP Java O(1)
120 Minimum Insertion Steps To Make A String Palindrome LC Java O(n2)
121 Minimum Path Cost In A Grid LC Java O(n2)
122 Minimum Path Sum LC CPP Java O(1)
123 Minimum Score Triangulation Of Polygon LC Java O(n2)
124 Minimum Sum Partition3317 GFG Java Hard O(n2)
125 Minimum Swaps To Make Sequences Increasing LC Java O(n)
126 N Queens LC CPP O(1)
127 N Queens Ii LC CPP O(1)
128 N Th Tribonacci Number LC Java O(n)
129 Ncr1019 GFG CPP Java Medium O(n2)
130 Nth Catalan Number0817 GFG CPP Java Easy O(n2)
131 Number Of Coins1824 GFG Java Medium O(n2)
132 Number Of Dice Rolls With Target Sum LC Java O(n2)
133 Number Of Distinct Roll Sequences LC CPP Java O(1)
134 Number Of Longest Increasing Subsequence LC CPP Java O(1)
135 Number Of Paths In A Matrix With K Coins2728 GFG Java null O(1)
136 Number Of People Aware Of A Secret LC Java O(n)
137 Number Of Ways Of Cutting A Pizza LC Java O(n2)
138 Number Of Ways To Form A Target String Given A Dictionary LC Java Python O(n)
139 Number Of Ways To Paint N 3 Grid LC Java O(n3)
140 Number Of Ways To Reach A Position After Exactly K Steps LC Java O(1)
141 Number Of Ways To Stay In The Same Place After Some Steps LC Java O(1)
142 Number Of Ways2552 GFG Java Medium O(n)
143 Numbers At Most N Given Digit Set LC Java O(n)
144 Ones And Zeroes LC Java O(n2)
145 Out Of Boundary Paths LC Java O(n)
146 Paint House Iii LC CPP Java O(1)
147 Painting The Fence3727 GFG CPP Java Medium O(1)
148 Palindrome Partitioning Ii LC GFG CPP null O(1)
149 Palindrome Partitioning Iv LC Java O(n)
150 Palindromic Substrings LC Java O(n)
151 Partition Array For Maximum Sum LC Java O(n2)
152 Partition To K Equal Sum Subsets LC Java O(n)
153 Path In Matrix3805 GFG Java Medium O(n)
154 Paths In Matrix Whose Sum Is Divisible By K LC Java O(1)
155 Perfect Squares LC Java O(n2)
156 Perfect Sum Problem5633 GFG Java Medium O(1)
157 Poor Pigs LC CPP O(1)
158 Predict The Winner LC Java O(n2)
159 Print All Lcs Sequences3413 GFG CPP Java Hard O(1)
160 Profitable Schemes LC Java O(1)
161 Range Sum Query 2d Immutable LC Java O(n)
162 Reach A Given Score 1587115621 GFG CPP Java Easy O(1)
163 Regular Expression Matching LC Java O(1)
164 Remove Boxes LC Java O(n)
165 Rotate Function LC Java O(n)
166 Russian Doll Envelopes LC CPP Java O(1)
167 Scramble String LC Java O(n)
168 Shortest Common Supersequence LC CPP Java O(1)
169 Sort Integers By The Power Value LC Java O(n)
170 Special Keyboard3018 GFG Java Medium O(n2)
171 Stickler Theif 1587115621 GFG CPP Java Easy O(1)
172 Student Attendance Record Ii LC Java O(n2)
173 Subset Sum Problem 1611555638 GFG CPP Java Medium O(n2)
174 Subset Sum Problem2014 GFG CPP Java Medium O(1)
175 Sum Of Floored Pairs LC Java O(n3)
176 Super Egg Drop LC GFG CPP Java Medium O(n3)
177 Super Ugly Number LC Java O(n2)
178 Target Sum LC CPP Java O(1)
179 Total Appeal Of A String LC LC LC CPP O(1)
180 Triangle LC Java O(n2)
181 Unique Paths LC CPP Java O(1)
182 Unique Paths Ii LC CPP Java O(1)
183 Wildcard Matching LC GFG CPP Java Medium O(1)
184 Wildcard String Matching1126 GFG Java Hard O(n2)
185 Word Break LC GFG CPP Java Medium O(1)
186 Word Wrap1646 GFG Java Hard O(n)

Graph

# Title Links Solution Difficulty Time Complexity Space Complexity
1 269f61832b146dd5e6d89b4ca18cbd2a2654ebbe GFG CPP Java Medium O(n2)
2 Number Of Islands BS GFG Java Medium O(n3)
3 Reverse Graph BS Java O(n3)
4 Unlock Rooms BS CPP Java O(1)
5 Accounts Merge LC Java O(n)
6 All Paths From Source To Target LC Java O(n)
7 Array Nesting LC Java O(n2)
8 Articulation Point 1 GFG CPP Java Hard O(n)
9 Articulation Point2616 GFG CPP null O(1)
10 As Far From Land As Possible LC Java O(n2)
11 Bfs Traversal Of Graph GFG CPP Java Easy O(n2)
12 Bridge Edge In Graph GFG CPP Java Medium O(n)
13 Build A Matrix With Conditions LC Java O(n2)
14 Cheapest Flights Within K Stops LC CPP Java O(n3)
15 Circle Of Strings4530 GFG CPP Java Medium O(n)
16 Clone Graph LC CPP Java O(n2)
17 Coloring A Border LC Java O(n)
18 Count Sub Islands LC Java O(n)
19 Count Unreachable Pairs Of Nodes In An Undirected Graph LC CPP Java O(n)
20 Course Schedule LC CPP Java O(n3)
21 Course Schedule Ii LC CPP Java O(n3)
22 Course Schedule Iv LC CPP Java O(n3)
23 Critical Connections In A Network LC CPP Java O(n)
24 Delete And Earn LC CPP O(1)
25 Depth First Traversal For A Graph GFG CPP Java Easy O(n)
26 Detect Cycle In A Directed Graph GFG CPP Java Medium O(n)
27 Detect Cycle In An Undirected Graph GFG CPP Java Medium O(n)
28 Distance From The Source Bellman Ford Algorithm GFG GFG CPP Java Medium O(n)
29 Employee Importance LC CPP Java O(n2)
30 Euler Circuit And Path GFG Java Medium O(n2)
31 Euler Circuit In A Directed Graph GFG Java Medium O(n2)
32 Evaluate Division LC Java O(n)
33 Find Closest Node To Given Two Nodes LC CPP Java O(n3)
34 Find Eventual Safe States LC Java O(n)
35 Find The City With The Smallest Number Of Neighbors At A Threshold Distance LC Java O(n2)
36 Find The Number Of Islands GFG CPP Medium O(1)
37 Find The Town Judge LC CPP Java O(n2)
38 Geekss Garden GFG Java Easy O(n4)
39 Implementing Dijkstra Set 1 Adjacency Matrix GFG CPP Java Medium O(1)
40 Implementing Floyd Warshall2042 GFG CPP Java Medium O(n)
41 Is Graph Bipartite LC GFG CPP Java Medium O(n3)
42 Journey To The Moon HR [CPP](./Graph/HRnk - JourneyToTheMoon.cpp) Java O(n)
43 Jump Game Iii LC Java O(1)
44 Jump Game Iv LC Java O(n2)
45 Jump Game Vii LC Java O(n)
46 Keys And Rooms LC Java O(n)
47 Largest Color Value In A Directed Graph LC Java Python O(n3)
48 Length Of Largest Region Of 1s 1587115620 GFG CPP Java Medium O(1)
49 Longest Cycle In A Graph LC CPP Java O(1)
50 Maximum Xor After Operations LC CPP O(1)
51 Min Cost To Connect All Points LC Java O(n)
52 Minimize Malware Spread LC Java O(n)
53 Minimize Malware Spread Ii LC Java O(n3)
54 Minimum Cost Path3833 GFG Java Hard O(n2)
55 Minimum Jumps To Reach Home LC Java O(n)
56 Minimum Number Of Days To Disconnect Island LC Java O(n)
57 Minimum Operations To Convert Number LC Java O(n3)
58 Minimum Score Of A Path Between Two Cities LC Java O(n2)
59 Minimum Spanning Tree GFG CPP Java Medium O(1)
60 Minimum Swaps GFG CPP Java Medium O(1)
61 Network Delay Time LC Java O(n)
62 Node With Highest Edge Score LC CPP Java O(1)
63 Number Of Closed Islands LC GFG Java Hard O(n)
64 Number Of Islands LC CPP O(1)
65 Number Of Operations To Make Network Connected LC CPP Java O(n)
66 Number Of Provinces LC CPP Java O(1)
67 Open The Lock LC Java O(n3)
68 Pacific Atlantic Water Flow LC Java O(n)
69 Parallel Courses LC CPP O(1)
70 Parallel Courses Iii LC CPP Java O(1)
71 Possible Bipartition LC Java O(n3)
72 Possible Paths Between 2 Vertices 1587115620 GFG Java Medium O(n2)
73 Prerequisite Tasks GFG CPP Java Medium O(1)
74 Print Adjacency List 1587115620 GFG CPP Java Easy O(1)
75 Process Restricted Friend Requests LC Java O(n)
76 Reachable Nodes With Restrictions LC CPP Java O(1)
77 Redundant Connection LC CPP Java O(1)
78 Redundant Connection Ii LC CPP Java O(1)
79 Reorder Routes To Make All Paths Lead To The City Zero LC Java O(n2)
80 Rotting Oranges LC GFG CPP Java Medium O(n)
81 Shortest Bridge LC Java O(n2)
82 Shortest Path In Binary Matrix LC Java O(n)
83 Shortest Path With Alternating Colors LC Java O(n2)
84 Shortest Source To Destination Path3544 GFG Java Medium O(n2)
85 Similar String Groups LC Java O(n2)
86 Smallest Missing Genetic Value In Each Subtree LC Java O(n)
87 Smallest String With Swaps LC Java O(n3)
88 Steps By Knight5927 GFG CPP Java Medium O(1)
89 Strongly Connected Component Tarjanss Algo 1587115621 GFG CPP Java Hard O(1)
90 Strongly Connected Components Kosarajus Algo GFG CPP Java Medium O(1)
91 Surrounded Regions LC Java O(n)
92 The Time When The Network Becomes Idle LC Java O(n3)
93 Time Needed To Inform All Employees LC Java O(n2)
94 Topological Sort GFG CPP Java Medium O(1)
95 Water And Jug Problem LC Java O(n3)
96 Where Will The Ball Fall LC Java O(n2)
97 Word Boggle4143 GFG Java Medium O(n4)
98 Word Ladder LC GFG CPP Java null O(1)
99 X Total Shapes3617 GFG Java Medium O(n3)

Greedy

# Title Links Solution Difficulty Time Complexity Space Complexity
1 919 LC2 Java O(n2)
2 Fractional Knapsack BS GFG CPP Medium O(1)
3 Append K Integers With Minimal Sum LC Java O(n)
4 Chocolate Distribution Problem3825 GFG CPP Java Easy O(n)
5 Cinema Seat Allocation LC Java O(n)
6 Coin Piles5152 GFG CPP Java Medium O(n2)
7 Construct Smallest Number From Di String LC Java O(n)
8 Course Schedule Iii LC CPP O(1)
9 Design An Atm Machine LC Java O(n)
10 Divide Intervals Into Minimum Number Of Groups LC Java O(n)
11 Element Appearing More Than 25 In Sorted Array LC Java O(n)
12 Find The Minimum Number Of Fibonacci Numbers Whose Sum Is K LC Java O(n)
13 Fractional Knapsack 1587115620 GFG Java Medium O(n)
14 Gas Station LC Java O(n)
15 Hand Of Straights LC Java O(n)
16 Huffman Encoding3345 GFG CPP Java Medium O(1)
17 Ipo LC Java O(n2)
18 Job Sequencing Problem 1587115620 GFG CPP Java Medium O(1)
19 Largest Number With Given Sum 1587115620 GFG Java Easy O(n)
20 Largest Palindromic Number LC Java O(n)
21 Largest Values From Labels LC Java O(n)
22 Least Number Of Unique Integers After K Removals LC Java O(n)
23 Length Of The Longest Alphabetical Continuous Substring LC Java O(n)
24 Longer Contiguous Segments Of Ones Than Zeros LC Java O(n)
25 Longest Binary Subsequence Less Than Or Equal To K LC CPP O(1)
26 Longest Subarray With Maximum Bitwise And LC Java O(n)
27 Longest Subsequence With Limited Sum LC Java O(n)
28 Make Array Zero By Subtracting Equal Amounts LC Java O(n)
29 Max Length Chain GFG CPP Java Medium O(1)
30 Maximize Sum After K Negations1149 GFG CPP Java Easy O(1)
31 Maximize Toys0331 GFG CPP Java Easy O(1)
32 Maximum Area Of A Piece Of Cake After Horizontal And Vertical Cuts LC Java O(n)
33 Maximum Number Of Consecutive Values You Can Make LC Java O(n)
34 Maximum Number Of Groups Entering A Competition LC CPP Java O(1)
35 Maximum Points You Can Obtain From Cards LC Java O(n)
36 Merge Intervals LC CPP O(1)
37 Minimum Cost Of Buying Candies With Discount LC Java O(n)
38 Minimum Cost Of Ropes 1587115620 GFG Java Easy O(n)
39 Minimum Deletions To Make Array Divisible LC Java O(n2)
40 Minimum Money Required Before Transactions LC Java O(n)
41 Minimum Number Of Refueling Stops LC Java O(n2)
42 Minimum Replacements To Sort The Array LC Java O(n)
43 Minimum Swaps To Make Strings Equal LC Java O(n)
44 Minimum Time To Make Rope Colorful LC Java O(n2)
45 Minimum Time To Type Word Using Special Typewriter LC Java O(n)
46 Most Profit Assigning Work LC Java O(n2)
47 N Meetings In One Room 1587115620 GFG CPP Java Easy O(n)
48 Optimal Partition Of String LC Java O(n)
49 Pairs With Specific Difference1533 GFG CPP Java Easy O(1)
50 Patching Array LC Java O(n2)
51 Queue Reconstruction By Height LC Java O(n2)
52 Rabbits In Forest LC Java O(n)
53 Reducing Dishes LC Java O(n)
54 Remove Colored Pieces If Both Neighbors Are The Same Color LC Java O(n)
55 Remove Digit From Number To Maximize Result LC Java O(n)
56 Removing Minimum And Maximum From Array LC Java O(n)
57 Shop In Candy Store1145 GFG CPP Java Easy O(n)
58 Shortest Distance To A Character LC Java O(n)
59 Shortest Impossible Sequence Of Rolls LC CPP Java O(1)
60 Smallest Number5829 GFG CPP null O(1)
61 Split The Binary String Into Substrings With Equal Number Of 0s And 1s GFG Java Medium O(n)
62 Task Scheduler LC CPP Java O(1)
63 Task Scheduler Ii LC Java O(n)
64 The Number Of Weak Characters In The Game LC Java O(n)
65 Water Connection Problem5822 GFG CPP Java Medium O(1)

Hashing

# Title Links Solution Difficulty Time Complexity Space Complexity
1 4sum Ii LC Java O(n2)
2 Condo Developers BS CPP O(1)
3 Palindromic Anagram BS Java O(n)
4 Smallest Intersecting Element BS Java O(n2)
5 Underground Tunnel BS CPP O(1)
6 All Oone Data Structure LC Java O(1)
7 Array Pair Sum Divisibility Problem3257 GFG Java Easy O(n)
8 Array Subset Of Another Array2317 GFG Java Easy O(n)
9 Bulls And Cows LC Java O(n)
10 Check Array Formation Through Concatenation LC Java O(n)
11 Check Distances Between Same Letters LC Java O(n)
12 Check If A String Contains All Binary Codes Of Size K LC CPP Java O(n)
13 Check If The Sentence Is Pangram LC Java O(n)
14 Continuous Subarray Sum LC Java O(n2)
15 Count Element Occurences GFG Java Medium O(n)
16 Count Good Meals LC CPP Java O(n2)
17 Count Number Of Bad Pairs LC Java O(n)
18 Count Number Of Distinct Integers After Reverse Operations LC Java O(n2)
19 Count Pairs In Array Divisible By K GFG Java Medium O(n)
20 Count Triplets 1 HR Java O(n)
21 Ctci Ransom Note HR Java O(n)
22 Degree Of An Array LC Java O(n)
23 Design A Number Container System LC CPP O(1)
24 Design Hashmap LC CPP Java O(n)
25 Design Hashset LC CPP Java O(n)
26 Determine If String Halves Are Alike LC Java O(n)
27 Evaluate The Bracket Pairs Of A String LC Java O(n2)
28 Find All Duplicates In An Array LC Java O(n)
29 Find All Lonely Numbers In The Array LC Java O(n)
30 Find All Numbers Disappeared In An Array LC CPP Java O(n)
31 Find Common Characters LC CPP Java O(n2)
32 Find Original Array From Doubled Array LC Java O(n)
33 Find Subarrays With Equal Sum LC Java O(n)
34 Find The Difference Of Two Arrays LC Java O(n)
35 Find Unique Binary String LC CPP Java O(n2)
36 First Missing Positive LC CPP Java O(n)
37 First Non Repeating Character In A Stream1216 GFG Java Medium O(n2)
38 First Repeating Element4018 GFG Java null O(n)
39 Group Anagrams LC Java O(n3)
40 In First But Second5423 GFG CPP Java Medium O(n)
41 Intersection Of Multiple Arrays LC Java O(n)
42 Largest Positive Integer That Exists With Its Negative LC Java O(n)
43 Longest K Unique Characters Substring0853 GFG CPP Easy O(1)
44 Longest Palindrome By Concatenating Two Letter Words LC Java O(n)
45 Longest Subarray With Sum Divisible By K1259 GFG Java Medium O(n2)
46 Longest Substring Without Repeating Characters LC CPP Java O(1)
47 Max Distance Between Same Elements GFG CPP Easy O(1)
48 Max Number Of K Sum Pairs LC Java O(n)
49 Max Sum Of A Pair With Equal Sum Of Digits LC Java O(n2)
50 Maximum Number Of Pairs In Array LC Java O(n)
51 Maximum Repeating Number4858 GFG CPP Basic O(1)
52 Merge Similar Items LC Java O(n)
53 Minimum Consecutive Cards To Pick Up LC Java O(n)
54 Minimum Index Sum Of Two Lists LC Java O(n)
55 Minimum Replacements To Sort The Array LC CPP O(1)
56 Most Common Word LC Java O(n)
57 Most Frequent Word In An Array Of Strings3528 GFG CPP Java Medium O(1)
58 Naming A Company LC Java O(n3)
59 Number Of Arithmetic Triplets LC Java O(n)
60 Number Of Ways Where Square Of Number Is Equal To Product Of Two Numbers LC Java O(n)
61 Pairs Of Songs With Total Durations Divisible By 60 LC CPP O(1)
62 Partition Labels LC Java O(n)
63 Points In Straight Line GFG Java Hard O(n2)
64 Rank Transform Of An Array LC Java O(n2)
65 Rearrange Characters To Make Target String LC Java O(n)
66 Recover The Original Array LC Java O(n2)
67 Relative Sorting4323 GFG Java Medium O(n2)
68 Remove Letter To Equalize Frequency LC Java O(n)
69 Reordered Power Of 2 LC Java O(n2)
70 Repeated Dna Sequences LC Java O(n)
71 Replace Elements In An Array LC Java O(n)
72 Rings And Rods LC Java O(n)
73 Sender With Largest Word Count LC Java O(n)
74 Sort Array By Increasing Frequency LC Java O(n2)
75 Sort The Jumbled Numbers LC Java O(n2)
76 Split Array Into Consecutive Subsequences LC Java O(n)
77 Stock Price Fluctuation LC Java O(n)
78 Subdomain Visit Count LC Java O(n2)
79 Swapping Pairs Make Sum Equal4142 GFG Java Easy O(n)
80 Task Scheduler Ii LC CPP O(1)
81 Top K Frequent Elements In Array GFG Java Easy O(n)
82 Top K Frequent Words LC Java O(n2)
83 Uncommon Words From Two Sentences LC CPP Java O(1)
84 Unique Email Addresses LC CPP Java O(1)
85 Unique Number Of Occurrences LC CPP O(1)

Heap

# Title Links Solution Difficulty Time Complexity Space Complexity
1 K Unique String BS Java O(n)
2 Optimal Decrement BS Java O(n)
3 Chinky And Diamonds3340 GFG Java Easy O(n)
4 Course Schedule Iii LC Java O(n)
5 Find K Pairs With Smallest Sums LC Java O(n)
6 Find K Th Smallest Element In Given N Ranges GFG Java Medium O(n2)
7 Find Median From Data Stream LC GFG CPP Java Hard O(1)
8 Find Nearest Point That Has The Same X Or Y Coordinate LC CPP Java O(1)
9 Find Subsequence Of Length K With The Largest Sum LC Java O(n)
10 Find The Kth Largest Integer In The Array LC Java O(n)
11 Find The Kth Smallest Sum Of A Matrix With Sorted Rows LC Java O(n2)
12 Furthest Building You Can Reach LC Java O(n)
13 Is Binary Tree Heap GFG CPP Java Easy O(1)
14 Jump Game Vi LC Java O(n2)
15 K Closest Points To Origin LC CPP Java O(n)
16 K Largest Elements4206 GFG Java Medium O(n)
17 K Th Largest Sum Contiguous Subarray GFG Java Medium O(n2)
18 Kth Largest Element In A Stream LC Java O(n)
19 Kth Largest Element In A Stream703. LC CPP O(1)
20 Kth Largest Element In An Array LC CPP Java O(n)
21 Kth Smallest Element5635 GFG CPP Medium O(1)
22 Maximum Number Of Events That Can Be Attended LC Java O(n2)
23 Maximum Performance Of A Team LC Java O(1)
24 Meeting Rooms Iii LC Java O(n)
25 Merge K Sorted Arrays GFG CPP Java Medium O(1)
26 Merge K Sorted Lists LC CPP Java O(1)
27 Merge Two Binary Max Heap0144 GFG Java Easy O(n)
28 Minimum Cost Of Ropes 1587115620 GFG CPP Java Easy O(1)
29 Minimum Cost To Hire K Workers LC Java O(n)
30 Minimum Obstacle Removal To Reach Corner LC Java O(n)
31 Minimum Sum4058 GFG CPP Java Medium O(1)
32 Process Tasks Using Servers LC Java O(n2)
33 Single Threaded Cpu LC Java O(n)
34 Sliding Window Median LC Java O(n)
35 Smallest Range Covering Elements From K Lists LC GFG CPP Java Hard O(1)
36 The K Weakest Rows In A Matrix LC Java O(n)
37 Top K Frequent Words LC CPP O(1)
38 Trapping Rain Water Ii LC Java O(n2)

Linked-List

# Title Links Solution Difficulty Time Complexity Space Complexity
1 87f12e5c728d69a5322634776b54c75897d14daa GFG Java Medium O(n2)
2 Central Linked List BS LC GFG CPP Easy O(n2)
3 Interleaved Linked List BS Java O(n)
4 Linked List Union BS Java O(n)
5 Pairwise Linked List Swap BS LC Java O(n)
6 Reverse A Linked List BS LC CPP Java O(1)
7 Swap Kth Node Values BS Java O(n)
8 Add 1 To A Number Represented As Linked List GFG CPP Java Easy O(1)
9 Add Two Numbers LC CPP Java O(n)
10 Add Two Numbers Ii LC GFG CPP Java Easy O(n)
11 Check If Linked List Is Pallindrome GFG CPP Java Easy O(n)
12 Circular Linked List GFG CPP Java Basic O(n)
13 Convert Binary Number In A Linked List To Integer LC CPP Java O(1)
14 Copy List With Random Pointer LC GFG CPP Java Hard O(n)
15 Decimal Equivalent Of Binary Linked List GFG CPP Java Easy O(n)
16 Delete Middle Of Linked List GFG CPP Java Easy O(n)
17 Delete N Nodes After M Nodes Of A Linked List GFG CPP Java Easy O(1)
18 Delete Nodes Having Greater Value On Right GFG CPP Java Medium O(1)
19 Delete The Middle Node Of A Linked List LC Java O(n)
20 Deletion And Reverse In Linked List GFG CPP Java Easy O(n)
21 Design Browser History LC Java O(n)
22 Find The Minimum And Maximum Number Of Nodes Between Critical Points LC Java O(n)
23 Flatten A Multilevel Doubly Linked List LC GFG CPP Java Medium O(n)
24 Given A Linked List Of 0s 1s And 2s Sort It GFG CPP Java Easy O(1)
25 Given A Linked List Reverse Alternate Nodes And Append At The End GFG CPP Java null O(1)
26 Implement Stack Using Queues LC CPP O(1)
27 Insertion Sort List LC Java O(n2)
28 Intersection Of Two Linked List GFG Java Easy O(n)
29 Intersection Of Two Sorted Linked Lists GFG Java Easy O(n)
30 Length Of Longest Palindrome In Linked List GFG Java Medium O(n)
31 Linked List Cycle LC CPP Java O(n)
32 Linked List Cycle Ii LC CPP Java O(1)
33 Linked List Of Strings Forms A Palindrome GFG Java Easy O(n)
34 Linked List That Is Sorted Alternatingly GFG Java Easy O(n)
35 Maximum Twin Sum Of A Linked List LC Java O(n)
36 Merge 2 Sorted Linked List In Reverse Order GFG Java Easy O(n)
37 Merge In Between Linked Lists LC Java O(n)
38 Merge Nodes In Between Zeros LC Java O(n)
39 Merge Sort On Doubly Linked List GFG Java Medium O(n)
40 Merge Two Sorted Lists LC CPP Java O(1)
41 Middle Of The Linked List LC Java O(n)
42 Modify Linked List 1 GFG Java Easy O(n)
43 Multiply Two Linked Lists GFG CPP Java Easy O(1)
44 Next Greater Node In Linked List LC Java O(n)
45 Odd Even Linked List LC CPP Java O(1)
46 Partition A Linked List Around A Given Value GFG CPP Java Medium O(1)
47 Partition List LC CPP Java O(1)
48 Polynomial Addition GFG Java Medium O(n)
49 Quick Sort On Linked List GFG CPP Java Medium O(1)
50 Remove All Occurences Of Duplicates In A Linked List GFG Java Medium O(n)
51 Remove Duplicates From Sorted List LC CPP Java O(1)
52 Remove Duplicates From Sorted List Ii LC CPP Java O(1)
53 Remove Every Kth Node GFG Java Easy O(n)
54 Remove Linked List Elements LC CPP Java O(1)
55 Remove Loop In Linked List GFG CPP Java Medium O(1)
56 Remove Nth Node From End Of List LC GFG CPP Java Easy O(1)
57 Remove Zero Sum Consecutive Nodes From Linked List LC Java O(n)
58 Reorder List LC Java O(n)
59 Reverse A Doubly Linked List GFG CPP Java Easy O(1)
60 Reverse A Linked List In Groups Of Given Size GFG CPP Medium O(1)
61 Reverse Linked List Ii LC CPP Java O(1)
62 Reverse Nodes In Even Length Groups LC Java O(n)
63 Reverse Nodes In K Group LC CPP Java O(1)
64 Rotate A Linked List GFG CPP Java Medium O(1)
65 Rotate List LC CPP O(1)
66 Segregate Even And Odd Nodes In A Linked List5035 GFG CPP Java Easy O(1)
67 Sort A Linked List GFG CPP Java Medium O(1)
68 Sort List LC CPP O(1)
69 Sorted Insert For Circular Linked List GFG Java Easy O(n)
70 Split A Circular Linked List Into Two Halves GFG CPP Java Easy O(n)
71 Split Linked List In Parts LC Java O(n2)
72 Swap Nodes In Pairs LC CPP O(1)

Matrix

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Bomber Man BS CPP Java O(n2)
2 Condo Developers BS Java O(n2)
3 Conway's Game Of Life BS CPP Java O(n2)
4 Enclosed Islands BS LC Java O(n2)
5 Matrix Search BS LC GFG CPP Java Medium O(1)
6 N Lexicographic Integers BS CPP O(1)
7 Spiral Matrix BS LC GFG Java Medium O(n)
8 Zero Matrix BS Java O(n2)
9 Adventure In A Maze2051 GFG Java null O(n)
10 Battleships In A Board LC Java O(n2)
11 Boolean Matrix Problem 1587115620 GFG CPP Java Medium O(n2)
12 Boundary Elements Of Matrix1102 GFG CPP Java Easy O(n)
13 Bricks Falling When Hit LC Java O(n)
14 Check If Matrix Is X Matrix LC Java O(n)
15 Check If There Is A Valid Parentheses String Path LC Java O(1)
16 Count Occurences Of A Given Word In A 2 D Array GFG Java null O(n)
17 Count Servers That Communicate LC CPP Java O(n2)
18 Design A Food Rating System LC CPP O(1)
19 Equal Row And Column Pairs LC CPP Java O(n2)
20 Find All Groups Of Farmland LC Java O(n3)
21 Find Nth Element Of Spiral Matrix GFG CPP Java Medium O(1)
22 Find The String In Grid0111 GFG Java Medium O(n2)
23 Flipping An Image LC Java O(n)
24 Flood Fill LC CPP O(1)
25 Game Of Life LC Java O(n2)
26 Island Perimeter LC Java O(n2)
27 Largest Local Values In A Matrix LC CPP Java O(n4)
28 Largest Rectangular Sub Matrix Whose Sum Is 0 GFG Java null O(n3)
29 Largest Zigzag Sequence5416 GFG Java Easy O(n3)
30 Magic Squares In Grid LC Java O(n)
31 Max Area Of Island LC CPP O(1)
32 Max Rectangle GFG Java Medium O(n2)
33 Maximum Area Of Triangle IB Java O(n2)
34 Maximum Difference Between Pair In A Matrix GFG Java Hard O(n2)
35 Maximum Rows Covered By Columns LC Java O(n2)
36 Maximum Sum Of An Hourglass LC Java O(n2)
37 Maximum Sum Rectangle2948 GFG Java null O(n)
38 Minesweeper LC Java O(n2)
39 Number Of Excellent Pairs LC CPP O(1)
40 Number Of Palindromic Paths In A Matrix0819 GFG Java Medium O(n2)
41 Prettyprint IB CPP Java O(1)
42 Print Diagonally1623 GFG Java Medium O(n2)
43 Print Matrix In Diagonal Pattern GFG Java Easy O(n2)
44 Queens That Can Attack The King LC Java O(n)
45 Rank Of Matrix GFG Java Medium O(n3)
46 Reverse Spiral Form Of Matrix4033 GFG Java Medium O(n2)
47 Rotate Image LC CPP Java O(1)
48 Rotate Matrix Elements Clockwise2336 GFG Java Easy O(n2)
49 Row With Max 1s0023 GFG CPP Java Medium O(1)
50 Row With Minimum Number Of 1s5430 GFG Java Easy O(n)
51 Search A 2d Matrix LC CPP Java O(1)
52 Search A 2d Matrix Ii LC GFG CPP Java Medium O(1)
53 Set Matrix Zeroes LC CPP Java O(n2)
54 Snakes And Ladders LC Java O(n2)
55 Sort The Matrix Diagonally LC GFG CPP Java Medium O(1)
56 Spiral Matrix LC CPP O(1)
57 Spiral Matrix Ii LC CPP Java O(1)
58 Spiral Matrix Iii LC Java O(n2)
59 Spiral Matrix Iv LC CPP Java O(1)
60 Transpose Matrix LC CPP Java O(1)
61 Valid Sudoku LC CPP Java O(n3)

Miscellaneous

# Title Links Solution Difficulty Time Complexity Space Complexity
1 132 Pattern LC Java O(n2)
2 Compressed Vector Product BS Java O(n)
3 Contiguous Intervals BS Java O(n)
4 Contiguously Increasing Numbers BS CPP Java O(1)
5 Dropped Sensor Metric BS Java O(n)
6 Quadratic Application BS Java O(n)
7 Roman Numeral To Integer BS Java O(n)
8 The Auditor BS LC Java O(n)
9 Underground Tunnel BS Java O(n)
10 Virtually Cloneable Stacks BS CPP Java O(1)
11 Zipped Iterator BS CPP Java O(1)
12 Array Of Doubled Pairs LC Java O(n)
13 Assign Cookies LC Java O(n2)
14 Basic Calculator LC Java O(n2)
15 Basic Calculator Ii LC Java O(n2)
16 Best Poker Hand LC CPP Java O(n)
17 Best Time To Buy And Sell Stock LC Java O(n)
18 Best Time To Buy And Sell Stock Iii LC GFG Java Medium O(n)
19 Binary Search GFG Java Basic O(n)
20 Binary Searchable Elements GFG Java Medium O(n)
21 Check If Number Has Equal Digit Count And Digit Value LC Java O(n)
22 Circular Array Loop LC Java O(n)
23 Compare Version Numbers LC Java O(n)
24 Concatenation Of Consecutive Binary Numbers LC Java O(n2)
25 Contains Duplicate Iii LC Java O(n)
26 Convert 1d Array Into 2d Array LC Java O(n)
27 Convert A Sentence Into Its Equivalent Mobile Numeric Keypad Sequence0547 GFG Java Easy O(n2)
28 Cosmic Number GFG Java Easy O(n2)
29 Count Asterisks LC Java O(n)
30 Count Days Spent Together LC Java O(n)
31 Count Items Matching A Rule LC Java O(n)
32 Data Stream As Disjoint Intervals LC Java O(n)
33 Decode The Slanted Ciphertext LC Java O(n)
34 Delete Characters To Make Fancy String LC Java O(n)
35 Delete Columns To Make Sorted LC Java O(n2)
36 Design A Food Rating System LC Java O(n)
37 Design A Number Container System LC Java O(1)
38 Design Bitset LC Java O(n)
39 Design Movie Rental System LC Java O(n3)
40 Design Underground System LC Java O(n)
41 Distribute Candies LC Java O(n)
42 Elimination Game LC Java O(n2)
43 Excel Sheet Column Title LC Java O(n)
44 Find Duplicate File In System LC Java O(n2)
45 Find Kth Bit In Nth Binary String LC Java O(n)
46 Finding Mk Average LC Java O(n)
47 Fizz Buzz LC Java O(n)
48 Flatten Nested List Iterator LC Java O(n)
49 Geek And Bridges GFG Java Easy O(n3)
50 Geek Onacci Number GFG Java Easy O(n2)
51 Get Watched Videos By Your Friends LC Java O(n3)
52 Happy Number LC Java O(n2)
53 Heaters LC Java O(n)
54 How Many Numbers Are Smaller Than The Current Number LC Java O(n)
55 Increasing Triplet Subsequence LC Java O(n)
56 Insert Delete Getrandom O1 LC Java O(n)
57 Integer To English Words LC Java O(n)
58 Invalid Transactions LC Java O(n2)
59 K Subarray Sum GFG Java Easy O(n2)
60 Keep Multiplying Found Values By Two LC Java O(n)
61 Keyboard Row LC Java O(n2)
62 Largest Number At Least Twice Of Others LC Java O(n)
63 Largest Perimeter Triangle LC Java O(n)
64 Latest Time By Replacing Hidden Digits LC Java O(1)
65 Letter Combinations Of A Phone Number LC Java O(n)
66 Longest Binary Subsequence Less Than Or Equal To K LC Java O(n)
67 Longest Harmonious Subsequence LC Java O(n)
68 Longest Increasing Subsequence Ii LC Java O(n2)
69 Longest Subarray With Atmost K Even Elements GFG Java Easy O(n2)
70 Longest Uploaded Prefix LC Java O(n)
71 Maximize The Confusion Of An Exam LC Java O(n2)
72 Maximum Consecutive Floors Without Special Floors LC Java O(n)
73 Maximum Difference Between Increasing Elements LC Java O(n)
74 Maximum Frequency Stack LC Java O(1)
75 Min Number Of Flips3210 GFG Java Easy O(n)
76 Mini Parser LC Java O(n2)
77 Minimum Amount Of Time To Collect Garbage LC Java O(n)
78 Minimum Amount Of Time To Fill Cups LC CPP Java O(1)
79 Minimum Deletions To Make Array Divisible LC CPP O(1)
80 Minimum Depth Of Binary Tree LC Java O(1)
81 Minimum Hours Of Training To Win A Competition LC Java O(n)
82 Minimum Number Of Increments On Subarrays To Form A Target Array LC Java O(n)
83 Minimum Number Of Moves To Seat Everyone LC Java O(n)
84 Minimum Number Of Operations To Convert Time LC Java O(1)
85 Minimum Operations To Reduce X To Zero LC Java O(n2)
86 Most Frequent Even Element LC Java O(n)
87 My Calendar I LC Java O(n)
88 My Calendar Ii LC Java O(n)
89 My Calendar Iii LC Java O(n)
90 New Year Chaos HR Java O(n)
91 Next Greater Element Iii LC CPP O(1)
92 Number Of Common Factors LC Java O(n)
93 Palindrome Number LC CPP O(1)
94 Peeking Iterator LC Java O(1)
95 Plates Between Candles LC Java O(n)
96 Power Of Four LC Java O(n)
97 Power Of Three LC Java O(n)
98 Previous Permutation With One Swap LC Java O(n)
99 Print Pattern3549 GFG Java Easy O(1)
100 Queries On Number Of Points Inside A Circle LC Java O(n2)
101 Query Kth Smallest Trimmed Number LC Java O(n2)
102 Rank Teams By Votes LC Java O(n)
103 Reach A Number LC Java O(n)
104 Reach The Target GFG Java Easy O(n)
105 Rearrange Array Elements By Sign LC Java O(n)
106 Remove Comments LC Java O(n2)
107 Replace By X GFG Java Easy O(n)
108 Replace Every Element With The Least Greater Element On Its Right GFG Java Hard O(n)
109 Robot Bounded In Circle LC Java O(n)
110 Shortest Subarray To Be Removed To Make Array Sorted LC Java O(n)
111 Simple Bank System LC Java O(1)
112 Slowest Key LC Java O(n)
113 Smallest Even Multiple LC Java O(n)
114 Smallest Factorial Number5929 GFG CPP Java Easy O(1)
115 Smallest Number In Infinite Set LC CPP Java O(1)
116 Smallest Value Of The Rearranged Number LC Java O(n)
117 Sort Even And Odd Indices Independently LC Java O(n)
118 Sorting Elements Of An Array By Frequency 1587115621 GFG Java Medium O(n2)
119 Stamping The Sequence LC Java O(n2)
120 Strictly Palindromic Number LC Java O(1)
121 Substring With Concatenation Of All Words LC Java O(n2)
122 Sum Of Number And Its Reverse LC Java O(n)
123 Sum Of Numbers With Units Digit K LC CPP Java O(1)
124 Sum Of Square Numbers LC Java O(n2)
125 Sum Of Two Numbers Without Using Arithmetic Operators GFG CPP Easy O(1)
126 The Employee That Worked On The Longest Task LC Java O(n)
127 The Latest Time To Catch A Bus LC Java O(n2)
128 The Skyline Problem LC Java O(n)
129 Third Maximum Number LC Java O(n)
130 Three Consecutive Odds LC Java O(n)
131 Time Needed To Rearrange A Binary String LC Java O(n2)
132 Two Furthest Houses With Different Colors LC Java O(n2)
133 Ugly Number Iii LC Java O(n)
134 Unique Morse Code Words LC Java O(n2)
135 Utf 8 Validation LC Java O(n)
136 Valid Mountain Array LC Java O(n)
137 Walking Robot Simulation LC Java O(n)
138 You And Your Books GFG Java Easy O(n)
139 Zigzag Conversion LC Java O(1)

Queue

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Circular Tour 1587115620 GFG CPP Java Medium O(n)
2 Design Circular Deque LC Java O(1)
3 Design Circular Queue LC Java O(1)
4 Design Front Middle Back Queue LC Java O(n)
5 First Negative Integer In Every Window Of Size K3345 GFG Java Easy O(n)
6 Implement Queue Using Array GFG CPP null O(1)
7 Implement Queue Using Stacks LC CPP Java O(1)
8 Lru Cache LC GFG CPP Java null O(1)
9 Maximum Sum Circular Subarray LC Java O(n2)
10 Number Of Recent Calls LC Java O(n)
11 Page Faults In Lru5603 GFG CPP Medium O(1)
12 Reveal Cards In Increasing Order LC Java O(n2)
13 Sliding Window Maximum LC GFG GFG CPP Java null O(n2)

Recursion

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Count Nodes In Complete Binary Tree BS LC CPP O(1)
2 N Lexicographic Integers BS LC CPP O(1)
3 Combinations LC CPP Java O(n)
4 Construct Quad Tree LC Java O(n2)
5 Flood Fill LC CPP O(1)
6 Flood Fill Algorithm1856 GFG Java Medium O(1)
7 Gray Code LC GFG CPP Java Easy O(n)
8 Josephus Problem GFG CPP Java Easy O(1)
9 Letter Case Permutation LC CPP Java O(1)
10 Number Of Paths0926 GFG Java Easy O(n)
11 Palindrome String0817 GFG CPP Java Easy O(1)
12 Pascals Triangle LC CPP Java O(1)
13 Pascals Triangle Ii LC CPP Java O(1)
14 Permutations Of A Given String2041 GFG CPP Medium O(1)
15 Power Set4302 GFG Java Easy O(1)
16 Restore Ip Addresses LC GFG Java Medium O(1)
17 Subsets LC CPP Java O(1)
18 Tower Of Hanoi 1587115621 GFG CPP Java Medium O(1)

Searching

# Title Links Solution Difficulty Time Complexity Space Complexity
1 3d27d4683c121c1f152ee8f41279255dc4430cf6 GFG CPP Java Medium O(1)
2 3sum LC CPP Java O(n3)
3 3sum Closest LC CPP Java O(1)
4 4sum LC CPP Java O(n4)
5 4sum Ii LC CPP O(1)
6 Insertion Index In Sorted List BS GFG Java Easy O(n)
7 Lowest Sum Of Pair Larger Than Target BS CPP Java O(1)
8 Allocate Minimum Number Of Pages0937 GFG Java Hard O(n)
9 Arithmetic Number2815 GFG CPP Java Easy O(1)
10 Arithmetic Subarrays LC CPP O(1)
11 Binary Search GFG CPP Basic O(1)
12 Capacity To Ship Packages Within D Days LC GFG Java Medium O(n)
13 Convert Sorted Array To Binary Search Tree LC Java O(n)
14 Convert Sorted List To Binary Search Tree LC Java O(n)
15 Count Of Smaller Numbers After Self LC Java O(n)
16 Count Pairs With Given Sum5022 GFG CPP Easy O(1)
17 Count Possible Triangles 1587115620 GFG CPP Java Medium O(n3)
18 Count Special Quadruplets LC CPP O(1)
19 Count The Zeros2550 GFG CPP Easy O(1)
20 Count Triplets With Sum Smaller Than X5549 GFG CPP Java Medium O(n2)
21 Find A Peak Element Ii LC Java O(n3)
22 Find Closest Number To Zero LC Java O(n)
23 Find First And Last Position Of Element In Sorted Array LC CPP Java O(1)
24 Find K Closest Elements LC CPP Java O(n)
25 Find Minimum In Rotated Sorted Array LC Java O(n)
26 Find Minimum In Rotated Sorted Array Ii LC Java O(n)
27 Find Missing And Repeating2512 GFG CPP Java Medium O(n)
28 Find Pair Given Difference1559 GFG CPP Java Easy O(n)
29 Find The Smallest Divisor Given A Threshold LC Java O(n)
30 First Bad Version LC CPP Java O(n)
31 Four Elements2452 GFG CPP Java Easy O(1)
32 Guess Number Higher Or Lower LC CPP Java O(n)
33 K Diff Pairs In An Array LC CPP Java O(n)
34 K Th Element Of Two Sorted Array1317 GFG CPP Medium O(1)
35 Koko Eating Bananas LC Java O(n)
36 Kth Missing Positive Number LC Java O(n)
37 Kth Smallest Number In Multiplication Table LC CPP Java O(n)
38 Last Day Where You Can Still Cross LC Java O(n2)
39 Maximum Distance Between A Pair Of Values LC Java O(n)
40 Maximum Number Of Robots Within Budget LC Java O(n)
41 Maximum Value In A Bitonic Array3001 GFG Java Easy O(n)
42 Minimum Element In A Sorted And Rotated Array3611 GFG Java Easy O(n)
43 Minimum Limit Of Balls In A Bag LC Java O(n)
44 Minimum Number Of Days To Make M Bouquets LC Java O(n)
45 Minimum Time To Complete Trips LC Java O(n)
46 My Calendar I LC CPP O(n2)
47 Number Of Pairs 1587115620 GFG Java Medium O(n)
48 Pair With Given Sum In A Sorted Array4940 GFG CPP Java Easy O(n)
49 Pair With Largest Sum Which Is Less Than K In The Array GFG CPP null O(1)
50 Range Frequency Queries LC Java O(n2)
51 Search In Rotated Sorted Array LC CPP Java O(1)
52 Search In Rotated Sorted Array Ii LC Java O(n)
53 Search Insert Position Of K In A Sorted Array GFG CPP Easy O(1)
54 Searching In An Array Where Adjacent Differ By At Most K0456 GFG CPP Easy O(1)
55 Sell Diminishing Valued Colored Balls LC Java O(n)
56 Single Element In A Sorted Array LC Java O(1)
57 Split Array Largest Sum LC Java O(n)
58 Sqrtx LC GFG CPP Java Medium O(1)
59 Successful Pairs Of Spells And Potions LC Java O(1)
60 The Painters Partition Problem1535 GFG Java Hard O(n3)
61 Time Based Key Value Store LC Java O(n2)
62 Triplet Sum In Array 1587115621 GFG CPP Java Medium O(1)
63 Triplets With Sum With Given Range GFG CPP Java Medium O(n2)
64 Two Sum LC CPP Java O(1)
65 Two Sum Ii Input Array Is Sorted LC CPP Java O(1)
66 Valid Perfect Square LC Java O(n)

Segment-Tree

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Range Sum Query Immutable LC Java O(n)
2 Range Sum Query Mutable LC Java O(n)
3 Smallest Subarrays With Maximum Bitwise Or LC Java O(n2)
4 Sum Of Even Numbers After Queries LC Java O(n)

Sorting

# Title Links Solution Difficulty Time Complexity Space Complexity
1 850 LC2 Java O(n2)
2 920 LC2 Java O(n)
3 Activity Selection 1587115620 GFG Java Easy O(n)
4 Advantage Shuffle LC Java O(n)
5 Arithmetic Subarrays LC Java O(n3)
6 Bubble Sort GFG CPP Java Easy O(n2)
7 Counting Sort GFG CPP Java Easy O(n2)
8 Find All Pairs Whose Sum Is X5808 GFG Java Easy O(n)
9 Heap Sort GFG CPP Java Medium O(1)
10 Insertion Sort GFG CPP Java Easy O(1)
11 Maximum Matching Of Players With Trainers LC Java O(n)
12 Merge Sort GFG CPP Java Medium O(1)
13 Minimum Time Difference LC Java O(n)
14 Nearly Sorted Algorithm GFG Java Medium O(n3)
15 Non Overlapping Intervals LC Java O(n)
16 Number Of Pairs Satisfying Inequality LC Java O(n2)
17 Quick Sort GFG CPP Java Medium O(1)
18 Selection Sort GFG CPP Java Easy O(n2)
19 Sort The People LC Java O(n)

Stack

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Circular Greater Element To The Right BS LC CPP Java O(1)
2 Wallstreet Bets BS LC CPP O(1)
3 Car Fleet LC Java O(n)
4 Count The Reversals0401 GFG Java Medium O(n)
5 Daily Temperatures LC Java O(n2)
6 Decode The String2444 GFG Java Easy O(n)
7 Design A Stack With Increment Operation LC CPP Java O(1)
8 Evaluate Reverse Polish Notation LC CPP Java O(1)
9 Fab3dbbdce746976ba35c7b9b24afde40eae5a04 GFG Java Medium O(n2)
10 Implement Stack Using Array GFG CPP Basic O(1)
11 Implement Stack Using Linked List GFG CPP Basic O(1)
12 Implement Stack Using Queues LC GFG Java null O(n)
13 Implement Two Stacks In An Array GFG CPP Java Easy O(1)
14 Infix To Postfix 1587115620 GFG CPP Java Easy O(1)
15 Largest Rectangle In Histogram LC GFG Java Medium O(n)
16 Longest Absolute File Path LC Java O(n)
17 Longest Valid Parentheses LC CPP Java O(1)
18 Maximal Rectangle LC Java O(n2)
19 Maximum Of Minimum For Every Window Size3453 GFG CPP Java Hard O(1)
20 Min Stack LC GFG CPP Java Easy O(1)
21 Minimum Swaps For Bracket Balancing2704 GFG Java Easy O(n2)
22 Next Greater Element I LC CPP Java O(1)
23 Number Of Visible People In A Queue LC Java O(n)
24 Online Stock Span LC CPP Java O(1)
25 Remove All Adjacent Duplicates In String LC Java O(n)
26 Remove All Adjacent Duplicates In String Ii LC Java O(n2)
27 Removing Stars From A String LC Java O(n2)
28 Simplify Path LC CPP Java O(1)
29 Sort A Stack GFG CPP Java Easy O(1)
30 Stack Permutations GFG Java Medium O(n2)
31 Steps To Make Array Non Decreasing LC Java O(1)
32 Stock Span Problem 1587115621 GFG CPP Java Medium O(1)
33 The Celebrity Problem GFG CPP Java Medium O(n2)
34 Using A Robot To Print The Lexicographically Smallest String LC Java O(n2)
35 Valid Parentheses LC CPP Java O(1)
36 Validate Stack Sequences LC Java Python O(n)

Strings

# Title Links Solution Difficulty Time Complexity Space Complexity
1 31272eef104840f7430ad9fd1d43b434a4b9596b GFG Java null O(n2)
2 856 LC2 Java O(n)
3 927 LC2 Java O(n)
4 Add Binary Numbers BS Java O(n)
5 Bulk Shift Letters BS Java O(n)
6 Largest Anagram Group BS Java O(n)
7 Lexicographically Smallest Non Palindromic String BS LC CPP Java O(1)
8 Lexicographically Smallest String Of Distance K BS LC CPP Java O(1)
9 Longest 1s After One Flip BS CPP Java O(1)
10 Roman Numeral To Integer BS LC CPP O(1)
11 Sentence Reversal BS CPP O(1)
12 Subsequence Strings BS Java O(n)
13 Unique String Frequencies BS LC CPP Java O(1)
14 Backspace String Compare LC Java O(n)
15 Buddy Strings LC Java O(n)
16 Camelcase Matching LC Java O(n2)
17 Consecutive Characters LC CPP Java O(n)
18 Convert A Sentence Into Its Equivalent Mobile Numeric Keypad Sequence0547 GFG CPP Easy O(1)
19 Count And Say LC CPP Java O(n2)
20 Count Asterisks LC CPP O(1)
21 Count Number Of Homogenous Substrings LC CPP Java O(n)
22 Count Number Of Substrings4528 GFG Java null O(n2)
23 Count Palindrome Sub Strings Of A String0652 GFG Java Medium O(n)
24 Count Prefixes Of A Given String LC Java O(n)
25 Count Substrings That Differ By One Character LC Java O(n3)
26 Count Words Obtained After Adding A Letter LC Java O(n2)
27 Counting Words With A Given Prefix LC Java O(n2)
28 Custom Sort String LC Java O(n2)
29 Decode String LC Java O(n)
30 Decode The Message LC CPP Java O(n)
31 Delete Operation For Two Strings LC Java O(n2)
32 Design A Text Editor LC Java O(n)
33 Determine If Two Strings Are Close LC Java O(n)
34 Distinct Palindromic Substrings5141 GFG Java Hard O(n)
35 Divide A String Into Groups Of Size K LC Java O(n2)
36 Find All Anagrams In A String LC CPP Java O(n2)
37 Find First Repeated Character4108 GFG CPP Basic O(1)
38 Find Resultant Array After Removing Anagrams LC Java O(n2)
39 Find The Missing No In String GFG Java null O(n2)
40 First Letter To Appear Twice LC CPP Java O(n)
41 First Non Repeating Character In A Stream1216 GFG CPP Java Medium O(n2)
42 First Unique Character In A String LC CPP Java O(n)
43 Flatten A Multilevel Doubly Linked List LC CPP O(1)
44 Fraction Addition And Subtraction LC Java O(n)
45 Generate A String With Characters That Have Odd Counts LC Java O(n)
46 Get Equal Substrings Within Budget LC Java O(n)
47 Goat Latin LC CPP Java O(n)
48 Greatest English Letter In Upper And Lower Case LC Java O(n)
49 Implement Atoi GFG Java Medium O(n)
50 Integer To Roman LC CPP O(1)
51 Intersection Of Two Linked List GFG CPP Easy O(1)
52 Intersection Of Two Sorted Linked Lists GFG CPP Easy O(1)
53 Isomorphic Strings LC GFG Java Easy O(n)
54 Largest Rectangle In Histogram LC GFG CPP Medium O(1)
55 Longest Chunked Palindrome Decomposition LC Java O(n)
56 Longest Even Length Substring GFG Java Medium O(n3)
57 Longest Happy Prefix LC GFG Java Medium O(n)
58 Longest Happy String LC Java O(n)
59 Longest K Unique Characters Substring0853 GFG Java Easy O(n2)
60 Longest Nice Substring LC Java O(n2)
61 Longest Palindrome LC Java O(n)
62 Longest Palindromic Substring LC GFG GFG CPP null O(1)
63 Longest Prefix Suffix2527 GFG CPP Medium O(1)
64 Longest String Chain LC Java O(n)
65 Longest Substring With At Least K Repeating Characters LC Java O(n2)
66 Match Substring After Replacement LC Java O(n2)
67 Maximize Number Of Subsequences In A String LC Java O(n)
68 Maximum Deletions On A String LC Java O(n)
69 Maximum Length Of A Concatenated String With Unique Characters LC Java O(n)
70 Maximum Number Of Vowels In A Substring Of Given Length LC CPP Java O(1)
71 Maximum Product Of Word Lengths LC Java O(n2)
72 Minimum Changes To Make Alternating Binary String LC Java O(n)
73 Minimum Indexed Character 1587115620 GFG Java Easy O(n)
74 Minimum Length Of String After Deleting Similar Ends LC Java O(n)
75 Minimum Number Of Frogs Croaking LC CPP Java O(1)
76 Minimum Number Of Steps To Make Two Strings Anagram LC Java O(n)
77 Minimum Number Of Steps To Make Two Strings Anagram Ii LC Java O(n)
78 Minimum Recolors To Get K Consecutive Black Blocks LC Java O(n)
79 Minimum Remove To Make Valid Parentheses LC Java O(n2)
80 Minimum Window Substring LC GFG CPP Java Medium O(1)
81 Move Pieces To Obtain A String LC CPP Java O(1)
82 Multiply Strings LC CPP Java O(1)
83 Number Of Matching Subsequences LC Java O(n2)
84 Number Of Substrings Containing All Three Characters LC Java O(n2)
85 Number Of Substrings With Only 1s LC CPP Java O(n)
86 Number Of Valid Clock Times LC Java O(n)
87 Palindrome Pairs LC Java O(n)
88 Palindrome String0817 GFG CPP Easy O(1)
89 Permutation In String LC CPP Java O(1)
90 Positions Of Large Groups LC Java O(n)
91 Query Kth Smallest Trimmed Number LC CPP O(1)
92 Rearrange Characters4649 GFG Java Medium O(n2)
93 Rearrange Spaces Between Words LC CPP Java O(1)
94 Remove All Duplicates From A Given String4321 GFG Java Easy O(n)
95 Reorder Data In Log Files LC Java O(1)
96 Reorganize String LC Java O(n)
97 Repetition Of K Length Substring GFG Java Easy O(n)
98 Replace All Digits With Characters LC Java O(n)
99 Replace The Substring For Balanced String LC Java O(n2)
100 Reverse A String GFG CPP Basic O(1)
101 Reverse Only Letters LC Java O(n2)
102 Reverse String Ii LC Java O(n)
103 Reverse Substrings Between Each Pair Of Parentheses LC Java O(n2)
104 Reverse Vowels Of A String LC Java O(n2)
105 Rotate String LC CPP Java O(1)
106 Run Length Encoding GFG Java Easy O(n)
107 Score Of Parentheses LC Java O(n2)
108 Search Pattern0205 GFG Java null O(n)
109 Sentence Similarity Iii LC Java O(n)
110 Sherlock And Anagrams HR Java O(n2)
111 Shifting Letters LC Java O(n)
112 Shifting Letters Ii LC Java O(n)
113 Shortest Palindrome LC Java O(n2)
114 Smallest Distant Window3132 GFG Java Medium O(n2)
115 Sort Characters By Frequency LC Java O(n2)
116 String Compression LC Java O(n)
117 String To Integer Atoi LC GFG CPP Medium O(1)
118 String Without Aaa Or Bbb LC Java O(n)
119 Strong Password Checker Ii LC Java O(n)
120 Substring With Concatenation Of All Words LC CPP O(1)
121 Substrings Of Length K With K 1 Distinct Elements GFG Java Medium O(n)
122 Swap For Longest Repeated Character Substring LC Java O(n3)
123 Text Justification LC CPP Java O(1)
124 Total Appeal Of A String LC Java O(n2)
125 Truncate Sentence LC Java O(n)
126 Uncommon Words From Two Sentences LC CPP O(1)
127 Unique Morse Code Words LC O(1)
128 Valid Anagram LC CPP Java O(n)
129 Valid Number LC CPP Java O(1)
130 Valid Palindrome LC CPP Java O(n)
131 Valid Palindrome Ii LC CPP Java O(n)
132 Validate An Ip Address 1587115621 GFG CPP Java Medium O(1)
133 Validate Ip Address LC Java O(n2)
134 Verifying An Alien Dictionary LC CPP Java O(n)
135 Vowels Of All Substrings LC Java O(n2)
136 Word Pattern LC Java O(n)

Tree

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Binary Tree To Linked List BS Java O(1)
2 Count Nodes In Complete Binary Tree BS LC Java O(n)
3 Delete Even Leaves BS Java O(1)
4 Elephant Tree BS GFG CPP Java Easy O(1)
5 Height Balanced Tree BS Java O(1)
6 Inorder Successor BS CPP Java O(1)
7 Largest Tree Sum Path BS Java O(n)
8 Leaves In Same Level BS GFG Java Easy O(1)
9 Longest Tree Sum Path From Root To Leaf BS Java O(1)
10 Lowest Common Ancestor BS GFG GFG Java Medium O(n)
11 Merging Binary Trees BS Java O(1)
12 Most Frequent Subtree Sum BS LC Java O(n)
13 Partition Tree BS Java O(n2)
14 Subtree With Maximum Value BS Java O(1)
15 Sum Tree BS Java O(1)
16 Symmetric Binary Tree BS LC Java O(1)
17 Tree Pruning BS Java O(1)
18 Univalue Tree BS Java O(1)
19 Add All Greater Values To Every Node In A Bst GFG CPP Java Medium O(1)
20 Add One Row To Tree LC Java O(1)
21 All Elements In Two Binary Search Trees LC Java O(1)
22 All Nodes Distance K In Binary Tree LC Java O(n3)
23 Amount Of Time For Binary Tree To Be Infected LC GFG CPP Java Hard O(n3)
24 Balance A Binary Search Tree LC Java O(1)
25 Balanced Binary Tree LC CPP Java O(1)
26 Binary Search Tree Iterator LC CPP Java O(n)
27 Binary Search Tree To Greater Sum Tree LC Java O(1)
28 Binary Tree Cameras LC Java O(1)
29 Binary Tree Inorder Traversal LC GFG CPP Medium O(1)
30 Binary Tree K Level Sum3857 GFG Java Easy O(n2)
31 Binary Tree Level Order Traversal LC GFG CPP Java Easy O(1)
32 Binary Tree Maximum Path Sum LC GFG Java Medium O(1)
33 Binary Tree Paths LC Java O(1)
34 Binary Tree Postorder Traversal LC GFG CPP Medium O(1)
35 Binary Tree Preorder Traversal LC GFG CPP Medium O(1)
36 Binary Tree Pruning LC Java O(1)
37 Binary Tree Tilt LC Java O(1)
38 Binary Tree To Bst GFG CPP Java Easy O(1)
39 Binary Tree To Dll GFG CPP Java Hard O(1)
40 Binary Tree Zigzag Level Order Traversal LC CPP Java O(1)
41 Bottom View Of Binary Tree GFG CPP Java Medium O(n)
42 Boundary Traversal Of Binary Tree GFG CPP Java Medium O(1)
43 Brothers From Different Root GFG CPP Java Easy O(n)
44 Bst To Greater Sum Tree GFG Java Medium O(1)
45 Check Completeness Of A Binary Tree LC Java O(n)
46 Check For Balanced Tree GFG CPP Easy O(1)
47 Check If Subtree GFG Java Medium O(n)
48 Check If Tree Is Isomorphic GFG Java Easy O(1)
49 Check Mirror In N Ary Tree1528 GFG Java Medium O(n2)
50 Check Whether Bst Contains Dead End GFG CPP Java Easy O(1)
51 Children Sum Parent GFG CPP Easy O(1)
52 Complete Binary Tree GFG Java Medium O(n2)
53 Complete Binary Tree Inserter LC Java O(n)
54 Connect Nodes At Same Level GFG Java Medium O(n)
55 Construct Binary Search Tree From Preorder Traversal LC GFG [LC](leetcode 1008, https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/) CPP Java Medium O(n)
56 Construct Binary Tree From Preorder And Postorder Traversal LC Java O(n)
57 Construct Binary Tree From String LC GFG LC2 CPP Medium O(1)
58 Construct Binary Tree From String With Bracket Representation GFG Java Medium O(n)
59 Construct String From Binary Tree LC CPP Java O(1)
60 Convert Sorted Array To Binary Search Tree LC CPP Java O(1)
61 Count Bst Nodes That Lie In A Given Range GFG CPP Java Medium O(1)
62 Count Good Nodes In Binary Tree LC CPP Java O(1)
63 Count Nodes Equal To Average Of Subtree LC Java O(1)
64 Count Nodes With The Highest Score LC Java O(n)
65 Count Number Of Subtrees Having Given Sum GFG Java Medium O(1)
66 Cousins In Binary Tree LC CPP Java O(n2)
67 Cousins Of A Given Node GFG Java Medium O(n2)
68 Create Binary Tree From Descriptions LC Java O(n)
69 Deepest Leaves Sum LC Java O(1)
70 Delete Leaves With A Given Value LC Java O(1)
71 Delete Node In A Bst LC CPP Java O(n)
72 Delete Nodes And Return Forest LC Java O(n)
73 Determine If Two Trees Are Identical GFG CPP Java Easy O(1)
74 Diagonal Traversal Of Binary Tree GFG CPP Java Medium O(n2)
75 Diameter Of Binary Tree GFG CPP Java Easy O(1)
76 Distribute Coins In Binary Tree LC GFG Java null O(1)
77 Duplicate Subtree In Binary Tree GFG CPP Java Medium O(n4)
78 Evaluate Boolean Binary Tree LC Java O(1)
79 Even Odd Tree LC Java O(n)
80 Expression Tree GFG Java Easy O(1)
81 Ffd66b6a0bf7cefb9987fa455974b6ea5695709e GFG Java Easy O(n2)
82 Find A Corresponding Node Of A Binary Tree In A Clone Of That Tree LC Java O(1)
83 Find A Pair With Given Target In Bst GFG CPP Java Medium O(n)
84 Find Duplicate Subtrees LC CPP Java O(n)
85 Find Largest Value In Each Tree Row LC Java O(n2)
86 Find Mode In Binary Search Tree LC CPP Java O(n)
87 Find The Closest Element In Bst GFG CPP Java Medium O(n)
88 Find The Distance Between Two Nodes4402 GFG Java Easy O(n)
89 Flatten Binary Tree To Linked List LC CPP Java O(n2)
90 Flip Binary Tree To Match Preorder Traversal LC Java O(1)
91 Foldable Binary Tree GFG Java Medium O(1)
92 Increasing Order Search Tree LC Java O(n)
93 Inorder Successor In Bst GFG CPP Java Easy O(1)
94 Inorder Traversal Iterative GFG Java Medium O(n)
95 Insert Into A Binary Search Tree LC CPP Java O(1)
96 Insufficient Nodes In Root To Leaf Paths LC Java O(1)
97 Invert Binary Tree LC CPP O(1)
98 Kth Largest Element In Bst GFG CPP Easy O(1)
99 Kth Smallest Element In A Bst LC GFG CPP Java Easy O(1)
100 Largest Bst Subtree LC GFG CPP Java Medium O(1)
101 Largest Subtree Sum In A Tree GFG Java Hard O(1)
102 Largest Value In Each Level GFG Java Easy O(n2)
103 Leaf At Same Level GFG CPP Easy O(1)
104 Leaf Similar Trees LC Java O(n2)
105 Left View Of Binary Tree GFG CPP Java Easy O(1)
106 Linked List In Binary Tree LC Java O(1)
107 Longest Path With Different Adjacent Characters LC Java O(n)
108 Longest Univalue Path LC Java O(1)
109 Longest Zigzag Path In A Binary Tree LC Java O(1)
110 Lowest Common Ancestor Of A Binary Search Tree LC GFG CPP Easy O(1)
111 Lowest Common Ancestor Of A Binary Tree LC GFG CPP Medium O(1)
112 Lowest Common Ancestor Of Deepest Leaves LC CPP Java O(1)
113 Maximum Binary Tree LC Java O(n)
114 Maximum Binary Tree Ii LC Java O(n)
115 Maximum Depth Of Binary Tree LC CPP Java O(1)
116 Maximum Difference Between Node And Ancestor LC GFG CPP Java Medium O(1)
117 Maximum Level Sum Of A Binary Tree LC CPP Java O(1)
118 Maximum Path Sum GFG Java Hard O(1)
119 Maximum Product Of Splitted Binary Tree LC Java O(1)
120 Maximum Sum Bst In Binary Tree LC CPP Java O(1)
121 Maximum Sum Leaf To Root Path GFG Java Medium O(1)
122 Maximum Width Of Binary Tree LC Java O(n2)
123 Maximum Width Of Tree GFG Java Easy O(n2)
124 Merge Bsts To Create Single Bst LC Java O(n)
125 Merge Two Binary Trees LC CPP Java O(1)
126 Merge Two Bst S GFG CPP Java Hard O(1)
127 Min Distance Between Two Given Nodes Of A Binary Tree GFG CPP Java Medium O(1)
128 Minimum Height Trees LC Java O(n2)
129 Minimum Swap Required To Convert Binary Tree To Binary Search Tree GFG Java Hard O(n2)
130 Minimum Time To Collect All Apples In A Tree LC Java O(1)
131 Mirror Tree GFG CPP Java Easy O(1)
132 N Ary Tree Level Order Traversal LC CPP Java O(1)
133 N Ary Tree Postorder Traversal LC CPP Java O(1)
134 N Ary Tree Preorder Traversal LC CPP Java O(1)
135 Next Right Node GFG CPP Easy O(1)
136 Node At Distance GFG Java Medium O(1)
137 Nodes At Given Distance In Binary Tree GFG Java Hard O(n)
138 Number Of Good Leaf Nodes Pairs LC Java O(n2)
139 Number Of Nodes In The Sub Tree With The Same Label LC Java O(n2)
140 Number Of Turns In Binary Tree GFG Java Hard O(1)
141 Odd Even Level Difference GFG Java Easy O(n2)
142 Pairs Violating Bst Property GFG Java Medium O(n)
143 Path In Zigzag Labelled Binary Tree LC Java O(n)
144 Path Sum LC CPP Java O(1)
145 Path Sum Ii LC CPP Java O(n)
146 Path Sum Iii LC GFG CPP Java Medium O(1)
147 Paths From Root With A Specified Sum GFG Java Medium O(n2)
148 Populate Inorder Successor For All Nodes GFG CPP Java Medium O(1)
149 Populating Next Right Pointers In Each Node LC CPP Java O(1)
150 Populating Next Right Pointers In Each Node Ii LC GFG CPP Java Medium O(1)
151 Postorder Traversal Iterative GFG Java Medium O(n)
152 Predecessor And Successor GFG Java Easy O(1)
153 Preorder Traversal And Bst4006 GFG CPP Java Medium O(n)
154 Preorder Traversal Iterative GFG CPP Java Medium O(1)
155 Print A Binary Tree In Vertical Order GFG CPP Medium O(1)
156 Print Binary Tree LC Java O(n2)
157 Print Nodes Having K Leaves GFG Java Medium O(1)
158 Pseudo Palindromic Paths In A Binary Tree LC Java O(n)
159 Recover A Tree From Preorder Traversal LC Java O(n2)
160 Recover Binary Search Tree LC GFG Java null O(n2)
161 Remove Bst Keys Outside Given Range GFG CPP Java Medium O(1)
162 Reverse Level Order Traversal GFG CPP Java Easy O(1)
163 Reverse Odd Levels Of Binary Tree LC Java O(n2)
164 Right View Of Binary Tree GFG CPP Java Easy O(1)
165 Second Minimum Node In A Binary Tree LC Java O(1)
166 Serialize And Deserialize Binary Tree LC GFG CPP Java Medium O(1)
167 Serialize And Deserialize Bst LC CPP O(1)
168 Single Valued Subtree GFG Java Medium O(1)
169 Smallest String Starting From Leaf LC Java O(n)
170 Smallest Subtree With All The Deepest Nodes LC CPP Java O(1)
171 Step By Step Directions From A Binary Tree Node To Another LC Java O(n)
172 Subtree Of Another Tree LC Java O(1)
173 Sum Of Binary Tree GFG Java Basic O(1)
174 Sum Of K Smallest Elements In Bst3029 GFG Java Easy O(n)
175 Sum Of Nodes With Even Valued Grandparent LC Java O(1)
176 Sum Of Root To Leaf Binary Numbers LC Java O(1)
177 Sum Of The Longest Bloodline Of A Tree GFG CPP Java Easy O(1)
178 Sum Root To Leaf Numbers LC Java O(n)
179 Sum Tree GFG CPP Java Medium O(1)
180 Symmetric Tree GFG CPP Java Easy O(1)
181 Top View Of Binary Tree GFG CPP Java Medium O(1)
182 Tree From Postorder And Inorder GFG CPP Java Medium O(n)
183 Trim A Binary Search Tree LC CPP Java O(1)
184 Two Mirror Trees GFG Java Easy O(n2)
185 Unique Binary Search Trees LC GFG CPP Java Medium O(1)
186 Unique Binary Search Trees Ii LC CPP Java O(1)
187 Validate Binary Search Tree LC CPP Java O(1)
188 Validate Binary Tree Nodes LC Java O(n)
189 Verify Preorder Serialization Of A Binary Tree LC Java O(1)
190 Vertical Order Traversal Of A Binary Tree LC GFG Java Medium O(n2)

Trie

# Title Links Solution Difficulty Time Complexity Space Complexity
1 Distinct Substrings BS GFG CPP Java Medium O(1)
2 Concatenated Words LC Java O(n)
3 Design Add And Search Words Data Structure LC CPP O(1)
4 Implement Trie Prefix Tree LC CPP Java O(1)
5 Map Sum Pairs LC Java O(n)
6 Maximum Xor Of Two Numbers In An Array LC CPP Java O(1)
7 Maximum Xor With An Element From Array LC CPP O(1)
8 Minimum Xor Value Pair GFG CPP Java Medium O(1)
9 Palindrome Pairs GFG Java Hard O(n)
10 Phone Directory4628 GFG CPP Java Hard O(1)
11 Prefix And Suffix Search LC Java O(n2)
12 Replace Words LC Java O(n2)
13 Search Suggestions System LC Java O(n)
14 Short Encoding Of Words LC CPP Java O(1)
15 Shortest Unique Prefix For Every Word GFG CPP Java Hard O(1)
16 Stream Of Characters LC CPP Java O(1)
17 Sum Of Prefix Scores Of Strings LC Java O(n)
18 Trie Delete GFG CPP Java Medium O(1)
19 Trie Insert And Search0651 GFG CPP Java Medium O(1)
20 Unique Rows In Boolean Matrix GFG CPP Java Easy O(1)