Problem · Matrix
Minimum Obstacle Removal
Learn this problemProblem statement
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.
Function
minimumObstacleRemoval(matrix: String[][]) → intExamples
Example 1
matrix = [["*", "*", "*", "*"], ["#", "*", ".", "*"], [".", ".", "#", "."], [".", "#", ".", "#"]]return = 4
Hence, return 4.