I have to solve a Nonogram in Python by using DFS search and I can collect the row permutations. So for each row in the Nonogram, I can have valid permutations like below (2