FastPrepFastPrep
Problem Brief

Minimum Obstacle Removal

FULLTIMEOA
See Uber online assessment and hiring insights

You are given a 2d matrix which consist of the following symbols ".", "#", "|", where "." represent free cell, "#" represent a obstacle, "|" denotes shape. Your task is to find out the minimum obstacle to remove from the matrix so that the shapes falls down to the bottom.

1Example 1

Input
matrix = [["*", "*", "*", "*"], ["#", "*", ".", "*"], [".", ".", "#", "."], [".", "#", ".", "#"]]
Output
4
Explanation
Example 1 illustration
Hence, return 4.
public int minimumObstacleRemoval(String[][] matrix) {
  // write your code here
}
Input

matrix

[["*", "*", "*", "*"], ["#", "*", ".", "*"], [".", ".", "#", "."], [".", "#", ".", "#"]]

Output

4

Sign in to submit your solution.