A Python Programming in Physics and Materials Science. In physics, chemistry and materials science, percolation refers to the movement and filtering of fluids through porous materials.(Wikipedia.org). Consider a simplified model below. Imagine, this is a filter or maybe some layers of stones such that when a certain amount of fluid is put on top, it will reach the bottom only if there is a direct passage. In this case, the blue squares serve as the porous materials or the holes where fluid may pass. Your task is to simulate this simple percolation by representing them in a 2-dimensional array. The input would be in a string, while the output would either be yes or no to indicate whether the fluid can pass through the filter or not.
Example:
Input: “1,0,0,0,0;0,1,0,0,0;0,1,0,0,0;0,0,1,0,0;0,0,0,1,0”
Output: Yes
Note: It should also work with these two inputs:
Extracted text: WATER HERE 1 0. 10|0||0 0 1 |0 0 ||0 1 ||0 0 0 1 WATER REACHES THE BOTTOM