
Vikas Shukla
@vik_7_
Followers
1
Following
101
Media
160
Statuses
161
Joined November 2024
π Day [160] of #gfg160dayschallenge @geeksforgeeks.π Problem: Unique Number II.π‘ Key Takeaway: Use XOR Partitioning to efficiently find two non-repeating numbers by isolating differing bits β achieves O(n) time and O(1) space. #DSA #problemsolving
0
0
0
π Day [159] of #gfg160dayschallenge @geeksforgeeks.π Problem: Unique Number I.π‘ Key Takeaway: Leverage the XOR property β a^a = 0 and a^0 = a β to find the single number in O(n) time and O(1) space. #BitManipulation #XORTrick #DSA #UniqueElement
0
0
0
π Day [158] of #gfg160dayschallenge @geeksforgeeks.π Problem: Missing in Array.π‘ Key Takeaway: Use sum formula or XOR technique to efficiently find the missing number in O(n) time and O(1) space. #Arrays #Maths #XORTrick #CodingChallenge #MissingNumber
0
0
0
π Day [157] of #gfg160dayschallenge @geeksforgeeks.π Problem: Find Only Repetitive Element from 1 to n-1.π‘ Key Takeaway: Use Floydβs Cycle Detection or frequency tracking to find the only repeated number in linear time without extra space. #Array #CycleDetection
0
0
0
π Day [156] of #gfg160dayschallenge @geeksforgeeks.π Problem: Maximum XOR of Two Numbers in an Array.π‘ Key Takeaway: Using bit manipulation and Trie optimization, we efficiently compute the max XOR of any pair in O(n). #BitManipulation #Trie #XOR #ArrayProblems
0
0
0
π Day [155] of #gfg160dayschallenge @geeksforgeeks.π Problem: Implement Trie.π‘ Key Takeaway: Mastering the Trie data structure enables ultra-fast prefix lookups, making it perfect for autocomplete, dictionary, and search engine implementations. #Trie #PrefixTree #StringSearch
0
0
0
π Day [154] of #gfg160dayschallenge @geeksforgeeks.π Problem: Minimum Weight Cycle.π‘ Key Takeaway: Use modified Floyd Warshall to detect and track cycles during path updates. Efficient for finding the lightest cycle in dense graphs. #GraphAlgorithms #FloydWarshall #gfg160
0
0
0
π Day [153] of #gfg160dayschallenge @geeksforgeeks.π Problem: Floyd Warshall.π‘ Key Takeaway: Update all-pairs shortest paths using intermediate nodes. Handles negative weights efficiently without negative cycles. In-place dynamic programming solution. #FloydWarshall #Graph
0
0
0
π Day [152] of #gfg160dayschallenge @geeksforgeeks.π Problem: Bellman-Ford.π‘ Key Takeaway: Relax all edges V-1 times to compute shortest paths. Detect negative cycles in one more pass. Handles negative weights safely. #BellmanFord #ShortestPath #GraphAlgorithm #NegativeCycle
0
0
0
π Day [151] of #gfg160dayschallenge @geeksforgeeks.π Problem: Alien Dictionary.π‘ Key Takeaway: Build a graph of character precedence using adjacent word comparisons, then apply topological sort to find valid order. #TopologicalSort #Graph #AlienDictionary #LexicographicOrder
0
0
3
π Day [150] of #gfg160dayschallenge @geeksforgeeks.π Problem: Clone an Undirected Graph.π‘ Key Takeaway: Use DFS or BFS with a hash map to track original-to-clone mappings, ensuring deep copies of all connected nodes. #GraphClone #DFS #BFS #HashMap #GFGChallenge
0
0
0
π Day [149] of #gfg160dayschallenge @geeksforgeeks.π Problem: Flood fill Algorithm.π‘ Key Takeaway: Perform DFS/BFS from the start pixel, updating connected pixels with the same original color in four directions. #FloodFill #DFS #BFS #GraphTraversal #GFGChallenge
0
0
0
π Day [148] of #gfg160dayschallenge @geeksforgeeks.π Problem: Dijkstra Algorithm.π‘ Key Takeaway: Use a priority queue to pick the minimum distance vertex and update neighboring verticesβ shortest distances without revisiting nodes. #Dijkstra #ShortestPath #PriorityQueue #DSA
0
0
0
π Day [147] of #gfg160dayschallenge @geeksforgeeks.π Problem: Minimum Cost to Connect All Houses.π‘ Key Takeaway: Model as a graph and use Primβs algorithm with Manhattan distances to find the minimum spanning tree and connect all houses. #Prim #MST #ManhattanDistance #Graphs
0
0
0
π Day [146] of #gfg160dayschallenge @geeksforgeeks.π Problem: Articulation Point - II.π‘ Key Takeaway: Use DFS with discovery and low times to find articulation points whose removal increases connected components in a graph. #Graph #DFS #ArticulationPoint #Tarjan #GFGChallenge
0
0
0
π Day [145] of #gfg160dayschallenge @geeksforgeeks .π§© Problem: Bridge Edge in an Undirected Graph.π‘ Key Idea: Use DFS to track discovery and low times. An edge (u,v) is a bridge if low[v] > disc[u], meaning no alternate path exists. #Graph #BridgeEdge #DFS #Tarjan #DSA
0
0
0
π Day [144] of #gfg160dayschallenge.π§© Problem: Cycle Detection in a Directed Graph.π‘ Key Idea: Use DFS with recursion stack or Kahnβs Algorithm to detect cycles. If a node is revisited while still in the recursion stack, a cycle exists. #Graph #CycleDetection #DirectedGraph
0
0
0
π Day [143] of #gfg160dayschallenge.π§© Problem: Topological Sort of a DAG.π‘ Key Idea: Use Kahnβs Algorithm (BFS) or DFS-based approach to order nodes such that for each edge u β v, u comes before v. π Tip: Topo sort only works on DAGs β no cycles allowed!.#Graph #DSA
0
0
0
π Day [142] of #gfg160dayschallenge @geeksforgeeks.ποΈ Problem: Find the Number of Islands.π‘ Key Takeaway: Use DFS/BFS to explore connected 'L's in all 8 directions. Count how many times you initiate a new DFS/BFS to identify total islands. #Graph #DFS #IslandCounter
0
0
0
π Day [141] of #gfg160dayschallenge @geeksforgeeks.π Problem: Undirected Graph Cycle Detection.π‘ Key Takeaway: Use DFS with parent tracking or BFS with visited set. If a visited node is reached again without backtracking through parent, a cycle exists. #Graph #CycleDetection
0
0
0