Given a grid of 0 (open) and 1 (wall) cells, find the length of the shortest path from a start cell to an end cell, moving up/down/left/right one cell at a time.
Input:
- Line 1:
rows cols
- Next
rows lines: a string of 0/1 of length cols
- Next line:
start_row start_col
- Next line:
end_row end_col
Output: the number of steps in the shortest path (0 if start == end), or -1 if unreachable.