Skip to content

C++ Topic wise Leetcode & GFG solutions ✨ (easy access)

License

Notifications You must be signed in to change notification settings

Anmol-Baranwal/Leetcode-GFG-DS-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fire My Leetcode & Geeksforgeeks Solutions Fire

ℹ️ All solutions are in C++ & are organized topic-wise.






Leetcode Questions

SNo Name Difficulty Question Solution
1 Two Sum Easy view view
2 Pascal's Triangle Easy view view
3 Pascal's Triangle II Easy view view
4 Best Time to Buy and Sell Stock Easy view view
5 Best Time to Buy and Sell Stock II Medium view view
6 Longest Consecutive Sequence Medium view view
7 Majority Element Easy view view
8 Majority Element II Medium view view
9 Remove Element Easy view view
10 4Sum Medium view view
11 Maximum Ascending Subarray Sum Medium view view
12 Find the Duplicate Number Medium view view
13 Next Permutation Medium view view
14 Search in Rotated Sorted Array Medium view view
15 Combination Sum Medium view view
16 Combination Sum II Medium view view
17 Permutations II Medium view view
18 Rotate Image Medium view view
19 Pow(x, n) Medium view view
20 Maximum Subarray Medium view view
21 Merge Intervals Medium view view
22 Set Mismatch Easy view view
23 Set Matrix Zeroes Medium view view
24 Palindrome Number Easy view view
25 Ugly Number Easy view view
26 Ugly Number II Medium view view
27 Maximum Length of Pair Chain Medium view view
28 Happy Number Easy view view

SNo Name Difficulty Question Solution
1 Integer to Roman Medium view view
2 Roman to Integer Easy view view
3 Longest Common Subsequence Medium view view
4 Longest Palindromic Subsequence Medium view view
5 Minimum Insertion Steps to Make a String Palindrome Hard view view
6 Shortest Common Supersequence Hard view view
7 Delete Operation for Two Strings Medium view view
8 Edit Distance Hard view view
9 Wildcard Matching Hard view view
23 Distinct Subsequences Hard view view

SNo Name Difficulty Question Solution
1 Number of Enclaves Medium view view
2 Critical Connections in a Network Hard view view
3 Word Ladder Hard view view
4 Surrounded Regions DFS Medium view view
5 Number of Ways to Arrive at Destination Medium view view
6 Number of Islands BFS Medium view view
7 Number of Islands DFS Medium view view
8 Course Schedule Medium view view
9 Course Schedule II Medium view view
10 Island Perimeter Easy view view
11 01 Matrix Medium view view
12 Flood Fill Easy view view
13 Is Graph Bipartite BFS Medium view view
14 Is Graph Bipartite DFS Medium view view
15 Rotting Oranges Medium view view
16 Cheapest Flights Within K Stops Medium view view
17 Network Delay Time using Bellman Ford Medium view view
18 Network Delay Time using Dijkstra Medium view view
19 Find the City With the Smallest Number of Neighbors at a Threshold Distance Medium view view
20 Most Stones Removed with Same Row or Column Medium view view
21 Path With Minimum Effort Medium view view
22 Shortest Path in Binary Matrix Medium view view
23 Max Area of Island Medium view view

SNo Name Difficulty Question Solution
1 Fibonacci Number Easy view view
2 N-th Tribonacci Number Easy view view
3 Climbing Stairs Easy view view
4 House Robber Medium view view
5 House Robber II Medium view view
6 Unique Paths Medium view view
7 Unique Paths II Medium view view
8 Minimum Path Sum Medium view view
9 Minimum Falling Path Sum Medium view view
10 Triangle Medium view view
11 Cherry Pickup II Hard view view
12 Target Sum Medium view view
13 Partition Equal Subset Sum Medium view view
14 Coin Change Medium view view
15 Coin Change II Medium view view
16 Longest Common Subsequence Medium view view
17 Longest Palindromic Subsequence Medium view view
18 Minimum Insertion Steps to Make a String Palindrome Hard view view
19 Shortest Common Supersequence Hard view view
20 Delete Operation for Two Strings Medium view view
21 Edit Distance Hard view view
22 Wildcard Matching Hard view view
23 Distinct Subsequences Hard view view
24 Best Time to Buy and Sell Stock II Medium view view
25 Best Time to Buy and Sell Stock III Hard view view
26 Best Time to Buy and Sell Stock IV Hard view view
27 Best Time to Buy and Sell Stock with Cooldown Medium view view
28 Best Time to Buy and Sell Stock with Transaction Fee Medium view view
29 Longest Increasing Subsequence Medium view view
30 Longest String Chain Medium view view
31 Burst Balloons Hard view view
31 Min Cost Climbing Stairs Easy view view
32 Number of Longest Increasing Subsequence Medium view view
33 Minimum Cost to Cut a Stick Hard view view
34 Partition Array for Maximum Sum Medium view view
35 Largest Divisible Subset Medium view view
36 Palindrome Partitioning II Hard view view
37 Count Square Submatrices with All Ones Medium view view

Geeksforgeeks Questions

SNo Name Difficulty Question Solution
1 BFS of Graph Easy view view
2 DFS of Graph Easy view view
3 Print adjacency list Easy view view
4 Flood fill Algorithm Medium view view
5 Rotten Oranges Medium view view
6 Number of Distinct Islands Medium view view
7 Bipartite Graph Medium view view
8 Detect cycle in a directed graph Medium view view
9 Detect cycle in an undirected graph BFS Medium view view
10 Detect cycle in an undirected graph DFS Medium view view
11 Distance of nearest cell having 1 Medium view view
12 Number of Enclaves Medium view view
13 Number of Provinces Medium view view
14 Replace O's with X's Medium view view
15 Word Ladder I Hard view view
16 Word Ladder II Hard view view
17 Topological sort Medium view view
18 Eventual Safe States Medium view view
19 Course Schedule Medium view view
20 Alien Dictionary Hard view view
21 Shortest Distance in a Binary Maze Medium view view
22 Path With Minimum Effort Medium view view
23 Number of Ways to Arrive at Destination Medium view view
24 Minimum Multiplications to reach End Medium view view
25 Implementing Dijkstra Algorithm using set Medium view view
26 Implementing Dijkstra Algorithm using priority queue Medium view view
27 Cheapest Flights Within K Stops Medium view view
28 Floyd Warshall Medium view view
29 Minimum Spanning Tree using Prims Algorithm Medium view view
30 Distance from the Source (Bellman-Ford Algorithm) Medium view view
31 Find the number of islands using DFS Medium view view
32 Alex Travelling using Bellman Ford Medium view view
33 Alex Travelling using Dijkstra Medium view view
34 Disjoint set (Union-Find) Easy view view
35 Strongly Connected Components (Kosaraju's Algo) Medium view view
36 Connecting the graph Medium view view
37 Number of Provinces using Disjoint Set Medium view view
38 Minimum Spanning Tree using Kruskal Algorithm Medium view view
39 City With the Smallest Number of Neighbors at a Threshold Distance Medium view view

SNo Name Difficulty Question Solution
1 Subset Sum Problem Medium view view
2 Perfect Sum Problem Medium view view
3 0 - 1 Knapsack Problem Medium view view
4 Knapsack with Duplicate Items Easy view view
5 Rod Cutting Medium view view
6 Longest Common Subsequence Medium view view
7 Longest Common Substring Medium view view
8 Longest Palindromic Subsequence Medium view view
9 Shortest Common Supersequence Medium view view
10 Form a palindrome Medium view view
11 Minimum number of deletions and insertions Easy view view
12 Edit Distance Medium view view
13 Wildcard Pattern Matching Medium view view
14 Longest Bitonic subsequence Medium view view
15 Burst Balloons Hard view view
16 Matrix Chain Multiplication Hard view view
17 Boolean Parenthesization Hard view view
18 Palindromic Partitioning Hard view view
19 Partition Array for Maximum Sum Medium view view

SNo Name Difficulty Question Solution
1 Longest Common Subsequence Medium view view
2 Longest Common Substring Medium view view
3 Longest Palindromic Subsequence Medium view view
4 Shortest Common Supersequence Medium view view
5 Form a palindrome Medium view view
6 Minimum number of deletions and insertions Easy view view
7 Edit Distance Medium view view
8 Wildcard Pattern Matching Medium view view

Thanks for Visiting

Please 🌟 this repository! It really helps others to find this!!