Vijay Pagare

DSA - 2 new (Course Schedule + Implement Trie)


207. Course Schedule

Insight: Standard DFS/Topo sort, ensure no cycles, handle disconnected graph.

Comment: Logic was there, fumbled with cycle detection + DFS true/false meaning, missed disconnected graph case.

208. Implement Trie

Insight: Have a TrieNode with children (map/object) + endOfWord boolean properties. Implement insert, search, startsWith by traversing each char.

Comment: Learnt how to implement Trie. (Was exciting, fun, and easy.)


Revised 3 problems - Maximum subarray; Minimum window substring; minimum of the rotated sorted array; and went through the theory/solution of valid graph tree.

#Dsa #Leetcode