leetle

Daily challenge for 2025-08-12

224. Parking Lot Pathfinder

Write a function solve that finds the shortest path from entrance to the nearest available parking spot. Grid: 0=empty, 1=car, 2=entrance. Return the minimum steps needed, or -1 if no path exists.

Example:
Input: [[2,0,1],[0,1,0],[0,0,0]]
Output: 2 (entrance to closest empty spot)

Run this challenge interactively in Python or JavaScript when the app loads.