Given an N x M grid representing a map with two cars, "a" and "b". Each car can move up, down, left, right, or stay in place at each step. The grid contains the following symbols:
".": Road (movable)."#": Wall (impassable)."a": Starting position of cara."b": Starting position of carb."A": Destination for cara."B": Destination for carb.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected