Practice Grid Teleportation Traversal
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
In matrix, a dot is an empty cell, a hash is an obstacle, and an uppercase letter marks a portal. Start at (0, 0) and reach the bottom-right cell using one move for each orthogonal step into a non-obstacle cell. From a portal cell, you may teleport for zero moves to another cell with the same letter, using each letter’s teleportation at most once in the journey. Return the minimum moves, or -1 if unreachable.
Source: Grid Teleportation Traversal on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
matrix = ["A..",".A.","..."]
2
# Example 2
matrix = [".#...",".#.#.",".#.#.","...#."]
13
Constraints
Related LeetCode Problems
Practice more problems similar to Grid Teleportation Traversal.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.