Description
Solutions
Minimum Obstacles To Remove To Allow Figure Fall
πŸ‘©β€πŸŽ“ NEW GRAD

Note - See the problem source section below for the original prompt 🐰🐰

10000 years agooooo, in the magical land of Gravity Falls, you found yourself playing a challenging puzzle game involving a mysterious, oddly-shaped figure that needed to fall gracefully to the bottom of a rectangular board. The board was made up of three types of enchanted cells: empty cells marked as '-', obstacles marked as '#', and the figure itself made of '*'. The figure was a single piece, with all of its parts connected by their sides, and it longed to touch the bottom of the board. Your quest was to help the figure descend by removing obstacles in its way, but only as many as absolutely necessary for it to finally touch the ground with at least one of its cells. The council of Gravity Falls understood that the task need not be approached in the most cunning way, but rather in a manner where you could explore every nook and cranny in at most board.length * board[0].length steps, solving the puzzle while uncovering the secrets of this gravity-bound world.

Example 1:

Input:  matrix = [['*', '*', '*'], ['#', '*', '*'], ['-', '-', '-'], ['-', '#', '#']]
Output: 2
Explanation:
Unfortunatelly, I did not find any explantion for this sample example..So I will add it later when I find more reliable source. If you happen to know the complete explanation, you are more than welcome to tell me and I will add it here :) You are the best! 🦁🦁
Constraints:
    🍎🍎
Thumbnail 0
Thumbnail 1
Testcase

Result
Case 1

input:

output: