Shortest distance from all buildings
A grid has empty land, buildings and obstacles. Find the empty cell whose total walking distance to every building is smallest (moving up, down, left or right), or return -1 if no empty cell reaches all buildings.
No answer yet. Write the first one; the best answer gets endorsed.
