Nitin Verma

366 posts

Nitin Verma

Nitin Verma

@45NitinVerma

BTech in CSE | Learning DSA and Web Development

India Katılım Eylül 2023
153 Takip Edilen199 Takipçiler
Nitin Verma
Nitin Verma@45NitinVerma·
🧩 Solved: Find Eventual Safe States on @LeetCode 💡 Idea: Safe nodes = nodes that don’t lead to cycles. Approach: • Reverse graph • Track indegrees • Start from terminal nodes • Use BFS (Topo Sort) to eliminate unsafe nodes ⏱️ Time: O(V + E) 📦 Space: O(V + E)
Nitin Verma tweet media
English
0
0
1
22
Nitin Verma
Nitin Verma@45NitinVerma·
Solved "Is Graph Bipartite?" on @LeetCode Idea: Try coloring the graph with 2 colors - Neighbor → opposite color - Same color conflict → not bipartite - Handle disconnected graphs too! ⏱️ Time: O(V + E) 📦 Space: O(V) #LeetCode #DSA #Graphs
Nitin Verma tweet media
English
1
0
2
14
Nitin Verma
Nitin Verma@45NitinVerma·
Solved “Number of Enclaves” on @LeetCode # Used Multi-Source BFS from boundary cells to mark all land connected to the edge, then counted the remaining unreachable land cells. ⏱ Time: O(m × n) 💾 Space: O(m × n) #DSA #LeetCode #BFS #Graphs #Java #CodingJourney
Nitin Verma tweet media
English
0
0
1
17
Nitin Verma
Nitin Verma@45NitinVerma·
Solved “Surrounded Regions” on @LeetCode 💻 🔹 Used DFS + Boundary Traversal 🔹 Start from edge 'O's → mark safe cells 🔹 Convert remaining 'O's to 'X' ⚡ Time Complexity: O(m × n) 📦 Space Complexity: O(m × n) #DSA #LeetCode #DFS #Java #Coding
Nitin Verma tweet media
English
1
0
3
19
Nitin Verma
Nitin Verma@45NitinVerma·
Solved “Flood Fill” on @LeetCode using DFS. Traversed the matrix in 4 directions and filled all connected pixels of the same color. - Time Complexity: O(m × n) - Space Complexity: O(m × n) #DSA #LeetCode #Java #DFS #CodingJourney
Nitin Verma tweet media
English
0
0
1
16
Nitin Verma
Nitin Verma@45NitinVerma·
Solved Inorder Predecessor & Successor in BST 🌳 📌 Find: • Predecessor → largest smaller value • Successor → smallest greater value ⚡ Used BST properties for efficient traversal ⏱️ Time: O(h) 💾 Space: O(1) #DSA #BST #Java #DataStructures #CodingNinjas #journey
Nitin Verma tweet mediaNitin Verma tweet media
English
0
0
1
13
Nitin Verma
Nitin Verma@45NitinVerma·
Solved “Koko Eating Bananas” 🍌 using Binary Search on Answer on @LeetCode Approach: Search for min eating speed k (1 → max pile) For each k, check if Koko can finish in h hours Adjust bounds with binary search ⏱ O(n log m) #DSA #BinarySearch #CodingNinjas #ProblemSolving
Nitin Verma tweet media
English
1
0
2
73