Ttracelitinblog.tracelit.dev·Apr 9 · 2 min readLeetCode 79: Word Search — Step-by-Step Visual TraceMedium — Backtracking | Depth-First Search | Matrix | String The Problem Given a 2D board of characters and a target word, determine if the word exists in the grid by connecting adjacent cells horizontally or vertically. Approach Use backtracking wit...00
Ttracelitinblog.tracelit.dev·Apr 9 · 3 min readLeetCode 212: Word Search Ii — Step-by-Step Visual TraceHard — Trie | Backtracking | DFS | Matrix The Problem Given a 2D board of characters and a list of words, find all words from the list that can be formed by sequentially adjacent letters on the board, where each cell can only be used once per word. A...00
Ttracelitinblog.tracelit.dev·Apr 9 · 1 min readLeetCode 127: Word Ladder — Step-by-Step Visual TraceHard — BFS | Graph | Hash Table | String The Problem Find the length of the shortest transformation sequence from beginWord to endWord, where each transformation changes exactly one letter and each intermediate word must exist in the given wordList. ...00
Ttracelitinblog.tracelit.dev·Apr 9 · 1 min readLeetCode 139: Word Break — Step-by-Step Visual TraceMedium — Dynamic Programming | String | Hash Table The Problem Given a string s and a dictionary of words wordDict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. Approach Uses dynamic programming whe...00
Ttracelitinblog.tracelit.dev·Apr 9 · 2 min readLeetCode 286: Walls And Gates — Step-by-Step Visual TraceMedium — BFS | Matrix | Graph The Problem Fill each empty room with the distance to its nearest gate, where rooms are represented by a 2D grid with gates (0), walls (-1), and empty rooms (INF). Approach Use multi-source BFS starting from all gates si...00