Day-11: (Solution)
Graph Valid Tree
Leetcode #886
Read : When can we call a Graph as TREE ?
SOLUTION code: https://gist.github.com/SuryaPratapK/e9d3dc3063b8c64805ff8adbfcf4cef5
Steps:-
A graph is TREE when:-
1 It is connected (has only 1 component)
2 It has no cycle
Please try the problem yourself and read the properties for a GRAPH to be called a tree ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Graph Valid Tree
Leetcode #886
Read : When can we call a Graph as TREE ?
SOLUTION code: https://gist.github.com/SuryaPratapK/e9d3dc3063b8c64805ff8adbfcf4cef5
Steps:-
A graph is TREE when:-
1 It is connected (has only 1 component)
2 It has no cycle
Please try the problem yourself and read the properties for a GRAPH to be called a tree ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Graph Valid Tree - LeetCode
Can you solve this real interview question? Graph Valid Tree - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Day-12:
Parallel Courses
Leetcode #1136
Algorithm: Topological Sort
Explanation Video: https://youtu.be/qe_pQCh09yU
Please try the problem yourself and watch the video to learn topological sort ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Parallel Courses
Leetcode #1136
Algorithm: Topological Sort
Explanation Video: https://youtu.be/qe_pQCh09yU
Please try the problem yourself and watch the video to learn topological sort ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Parallel Courses - LeetCode
Can you solve this real interview question? Parallel Courses - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Day-12: (Solution)
Parallel Courses
Leetcode #1136
Algorithm: Topological Sort
Topological Sort: https://youtu.be/qe_pQCh09yU
SOLUTION code: https://gist.github.com/SuryaPratapK/a724fe7d30957c11f17abf35ae8be38b
Please try the problem yourself and watch the video to learn topological sort ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Parallel Courses
Leetcode #1136
Algorithm: Topological Sort
Topological Sort: https://youtu.be/qe_pQCh09yU
SOLUTION code: https://gist.github.com/SuryaPratapK/a724fe7d30957c11f17abf35ae8be38b
Please try the problem yourself and watch the video to learn topological sort ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Parallel Courses - LeetCode
Can you solve this real interview question? Parallel Courses - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Day-13:
Path with Maximum Probability
Leetcode #1136
Algorithm: Dijkstra Algo
Dijkstra Explained: https://youtu.be/Sj5Z-jaE2x0
Please try the problem yourself and watch the video to learn Dijkstra Algorithm ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Path with Maximum Probability
Leetcode #1136
Algorithm: Dijkstra Algo
Dijkstra Explained: https://youtu.be/Sj5Z-jaE2x0
Please try the problem yourself and watch the video to learn Dijkstra Algorithm ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Path with Maximum Probability - LeetCode
Can you solve this real interview question? Path with Maximum Probability - You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probabilityโฆ
Day-13: (Solution)
Path with Maximum Probability
Leetcode #1136
Algorithm: Dijkstra Algo
Dijkstra Explained: https://youtu.be/Sj5Z-jaE2x0
Solution CODE: https://gist.github.com/SuryaPratapK/c5a36ce6d331de94b367495354fbe4da
Please try the problem yourself and watch the video to learn Dijkstra Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Path with Maximum Probability
Leetcode #1136
Algorithm: Dijkstra Algo
Dijkstra Explained: https://youtu.be/Sj5Z-jaE2x0
Solution CODE: https://gist.github.com/SuryaPratapK/c5a36ce6d331de94b367495354fbe4da
Please try the problem yourself and watch the video to learn Dijkstra Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Path with Maximum Probability - LeetCode
Can you solve this real interview question? Path with Maximum Probability - You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probabilityโฆ
Day-14:
Course Schedule IV
Leetcode #1462
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Course Schedule IV
Leetcode #1462
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Course Schedule IV - LeetCode
Can you solve this real interview question? Course Schedule IV - There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must takeโฆ
Day-14: (Solution)
Course Schedule IV
Leetcode #1462
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Solution CODE: https://gist.github.com/SuryaPratapK/f30a92fb2f8a6fead594f59d122227f8
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Course Schedule IV
Leetcode #1462
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Solution CODE: https://gist.github.com/SuryaPratapK/f30a92fb2f8a6fead594f59d122227f8
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Course Schedule IV - LeetCode
Can you solve this real interview question? Course Schedule IV - There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must takeโฆ
Day-15:
Find the City With the Smallest Number of Neighbors at a Threshold Distance
Leetcode #1334
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Find the City With the Smallest Number of Neighbors at a Threshold Distance
Leetcode #1334
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Find the City With the Smallest Number of Neighbors at a Threshold Distance - LeetCode
Can you solve this real interview question? Find the City With the Smallest Number of Neighbors at a Threshold Distance - There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional andโฆ
Day-15: (Solution)
Find the City With the Smallest Number of Neighbors at a Threshold Distance
Leetcode #1334
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Solution CODE: https://gist.github.com/SuryaPratapK/110cf5701e084dd70314cd147f241ee2
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Find the City With the Smallest Number of Neighbors at a Threshold Distance
Leetcode #1334
Algorithm: Floyd Warshall
Floyd Warshall Algo Explained: https://youtu.be/nV_wOZnhbog
Solution CODE: https://gist.github.com/SuryaPratapK/110cf5701e084dd70314cd147f241ee2
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Find the City With the Smallest Number of Neighbors at a Threshold Distance - LeetCode
Can you solve this real interview question? Find the City With the Smallest Number of Neighbors at a Threshold Distance - There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional andโฆ
Day-16:
Min Cost to Connect All Points
Leetcode #1584
Algorithm: Prims/Kruskals MST (Minimum Spanning Tree)
Prims MST Algo Explained: https://youtu.be/xthRL0lcx2w
Kruskalโs MST Algo Explained: https://youtu.be/_Iz-QLBGKpM
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Min Cost to Connect All Points
Leetcode #1584
Algorithm: Prims/Kruskals MST (Minimum Spanning Tree)
Prims MST Algo Explained: https://youtu.be/xthRL0lcx2w
Kruskalโs MST Algo Explained: https://youtu.be/_Iz-QLBGKpM
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Min Cost to Connect All Points - LeetCode
Can you solve this real interview question? Min Cost to Connect All Points - You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].
The cost of connecting two points [xi, yi] and [xj, yj]โฆ
The cost of connecting two points [xi, yi] and [xj, yj]โฆ
Day-16: (Solution)
Min Cost to Connect All Points
Leetcode #1584
Algorithm: Prims/Kruskals MST (Minimum Spanning Tree)
Prims MST Algo Explained: https://youtu.be/xthRL0lcx2w
Kruskalโs MST Algo Explained: https://youtu.be/_Iz-QLBGKpM
Solution CODE: https://gist.github.com/SuryaPratapK/9fc73aa84c70ba77bb00bae3b18f2bfb
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Min Cost to Connect All Points
Leetcode #1584
Algorithm: Prims/Kruskals MST (Minimum Spanning Tree)
Prims MST Algo Explained: https://youtu.be/xthRL0lcx2w
Kruskalโs MST Algo Explained: https://youtu.be/_Iz-QLBGKpM
Solution CODE: https://gist.github.com/SuryaPratapK/9fc73aa84c70ba77bb00bae3b18f2bfb
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Min Cost to Connect All Points - LeetCode
Can you solve this real interview question? Min Cost to Connect All Points - You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].
The cost of connecting two points [xi, yi] and [xj, yj]โฆ
The cost of connecting two points [xi, yi] and [xj, yj]โฆ
Day-17:
Number of Connected Components in an Undirected Graph
Leetcode #323
Algorithm: Disjoint Set Data Structure
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Number of Connected Components in an Undirected Graph
Leetcode #323
Algorithm: Disjoint Set Data Structure
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Number of Connected Components in an Undirected Graph - LeetCode
Can you solve this real interview question? Number of Connected Components in an Undirected Graph - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Day-17: (solution)
Number of Connected Components in an Undirected Graph
Leetcode #323
Algorithm: Disjoint Set Data Structure
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Solution CODE: https://gist.github.com/SuryaPratapK/07f8c291631e2a39f374bfa922c4e90a
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Number of Connected Components in an Undirected Graph
Leetcode #323
Algorithm: Disjoint Set Data Structure
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Solution CODE: https://gist.github.com/SuryaPratapK/07f8c291631e2a39f374bfa922c4e90a
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Number of Connected Components in an Undirected Graph - LeetCode
Can you solve this real interview question? Number of Connected Components in an Undirected Graph - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Day-18:
Making A Large Island
Leetcode #827
Algorithm: DFS/BFS/Disjoint-Set
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Making A Large Island
Leetcode #827
Algorithm: DFS/BFS/Disjoint-Set
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Making A Large Island - LeetCode
Can you solve this real interview question? Making A Large Island - You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1.
Return the size of the largest island in grid after applying this operation.
An island is a 4โฆ
Return the size of the largest island in grid after applying this operation.
An island is a 4โฆ
Day-18: (Solution)
Making A Large Island
Leetcode #827
Algorithm: DFS/BFS/Disjoint-Set
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Solution CODE: https://gist.github.com/SuryaPratapK/ce1fb8d587af4b3b420210373cecece7
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Making A Large Island
Leetcode #827
Algorithm: DFS/BFS/Disjoint-Set
Disjoint Set VIDEO: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by RANK & Path Compression): https://youtu.be/kaBX2s3pYO4
Solution CODE: https://gist.github.com/SuryaPratapK/ce1fb8d587af4b3b420210373cecece7
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Making A Large Island - LeetCode
Can you solve this real interview question? Making A Large Island - You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1.
Return the size of the largest island in grid after applying this operation.
An island is a 4โฆ
Return the size of the largest island in grid after applying this operation.
An island is a 4โฆ
Day-19:
Minimum Degree of a Connected Trio in a Graph
Leetcode #827
Algorithm: Adjancency Matrix
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Minimum Degree of a Connected Trio in a Graph
Leetcode #827
Algorithm: Adjancency Matrix
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Minimum Degree of a Connected Trio in a Graph - LeetCode
Can you solve this real interview question? Minimum Degree of a Connected Trio in a Graph - You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicatesโฆ
Day-19: (Solution)
Minimum Degree of a Connected Trio in a Graph
Leetcode #827
Algorithm: Adjancency Matrix
Solution CODE: https://gist.github.com/SuryaPratapK/6fc3e5d10ea63fca13c71a57e6fe3c31
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Minimum Degree of a Connected Trio in a Graph
Leetcode #827
Algorithm: Adjancency Matrix
Solution CODE: https://gist.github.com/SuryaPratapK/6fc3e5d10ea63fca13c71a57e6fe3c31
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Minimum Degree of a Connected Trio in a Graph - LeetCode
Can you solve this real interview question? Minimum Degree of a Connected Trio in a Graph - You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicatesโฆ
Day-20:
Couples Holding Hands
Leetcode #765
Algorithm: Disjoint Set
Disjoint Set: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by Rank & Path Compression): https://youtu.be/kaBX2s3pYO4
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Couples Holding Hands
Leetcode #765
Algorithm: Disjoint Set
Disjoint Set: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by Rank & Path Compression): https://youtu.be/kaBX2s3pYO4
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Couples Holding Hands - LeetCode
Can you solve this real interview question? Couples Holding Hands - There are n couples sitting in 2n seats arranged in a row and want to hold hands.
The people and seats are represented by an integer array row where row[i] is the ID of the person sittingโฆ
The people and seats are represented by an integer array row where row[i] is the ID of the person sittingโฆ
Day-20:
Couples Holding Hands
Leetcode #765
Algorithm: Disjoint Set
Disjoint Set: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by Rank & Path Compression): https://youtu.be/kaBX2s3pYO4
Solution CODE: https://gist.github.com/SuryaPratapK/ea24aa7e0be6200ad2e1a2a9d36b6c5e
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
Couples Holding Hands
Leetcode #765
Algorithm: Disjoint Set
Disjoint Set: https://youtu.be/eTaWFhPXPz4
Disjoint Set (Union by Rank & Path Compression): https://youtu.be/kaBX2s3pYO4
Solution CODE: https://gist.github.com/SuryaPratapK/ea24aa7e0be6200ad2e1a2a9d36b6c5e
Please try the problem yourself and watch the video to learn the Algorithm ๐
Please SHARE this initiative with your friends as well ๐
#30DaysOfGraph #techdose #interviewpreparation #graphs #dsa
LeetCode
Couples Holding Hands - LeetCode
Can you solve this real interview question? Couples Holding Hands - There are n couples sitting in 2n seats arranged in a row and want to hold hands.
The people and seats are represented by an integer array row where row[i] is the ID of the person sittingโฆ
The people and seats are represented by an integer array row where row[i] is the ID of the person sittingโฆ