Hello ! I'm looking for a faster solution to this problem could you please share it with me if you hyave an idea ?
We have an image (in the form of a matrix) divided by some axis-aligned lines (in the form of a +) in a way that it has splitted firstly into 4 pieces
then each of those 4 pieces could also be divided into 4 pieces themselves or not . And if they're divided , the splitter lines lie within those pieces (maximum length equals
the length of the side of the specific rectangular piece) a new color is used in each level of sub-division.
The objective is to find the row index and column index of the splitter lines which divide the image in the first level .
My approach is to iterate over each index in the range(len(matrix)) which means through each row , turn it into a set, get the len() of it and if equal to 1 ,
assign it to row index .
Then get one of the items in that row and index it in the row above , so it tells us where the column crosses the row above . and then we have the column index as well
I'd really appreciate a faster or more efficient approach
We have an image (in the form of a matrix) divided by some axis-aligned lines (in the form of a +) in a way that it has splitted firstly into 4 pieces
then each of those 4 pieces could also be divided into 4 pieces themselves or not . And if they're divided , the splitter lines lie within those pieces (maximum length equals
the length of the side of the specific rectangular piece) a new color is used in each level of sub-division.
The objective is to find the row index and column index of the splitter lines which divide the image in the first level .
My approach is to iterate over each index in the range(len(matrix)) which means through each row , turn it into a set, get the len() of it and if equal to 1 ,
assign it to row index .
Then get one of the items in that row and index it in the row above , so it tells us where the column crosses the row above . and then we have the column index as well
I'd really appreciate a faster or more efficient approach