human
Solve in Python:
Once you complete this kata, there is a [15x15 Version](http://www.codewars.com/kata/15x15-nonogram-solver) that you can try.
And once you complete that, you can do the [Multisize Version](https://www.codewars.com/kata/5a5519858803853691000069) which goes up to 50x50.

# Description

For this kata, you will be making a Nonogram solver. :)

If you don't know what Nonograms are, you can [look at some instructions](https://www.puzzle-nonograms.com/faq.php) and also [try out some Nonograms here.](https://www.puzzle-nonograms.com/)

For this kata, you will only have to solve 5x5 Nonograms. :)

# Instructions

You need to complete the Nonogram class and the solve method:
```python
class Nonogram:

    def __init__(self, clues):
        pass

    def solve(self):
        pass
```

You will be given the clues and you should return the solved puzzle. All the puzzles will be solveable so you will not need to worry about that.

```if:python
The clues will be a tuple of the horizontal clues, then the vertical clues, which will contain the individual clues. For example, for the Nonogram:
```

```if:java
The clues will be a three dimensional array of the horizontal clues, then the vertical clues, which will contain the individual clues. For example, for the Nonogram:
```

```
    |   |   | 1 |   |   |
    | 1 |   | 1 |   |   |
    | 1 | 4 | 1 | 3 | 1 |
-------------------------
  1 |   |   |   |   |   |
-------------------------
  2 |   |   |   |   |   |
-------------------------
  3 |   |   |   |   |   |
-------------------------
2 1 |   |   |   |   |   |
-------------------------
  4 |   |   |   |   |   |
-------------------------
```
The clues are on the top and the left of the puzzle, so in this case:
```if:python
The horizontal clues are: `((1, 1), (4,), (1, 1, 1), (3,), (1,))`, and the vertical clues are: `((1,), (2,), (3,), (2, 1), (4,))`. The horizontal clues are given from left to right. If there is more than one clue for the same column, the upper clue is given first. The vertical clues are given from top to...
 ... Here Nonograms are, you can [look at some instructions](https://www?
assistant
#Here Nonograms are, you can [look at some instructions](https://www.

from copy import deepcopy

class Nonogram:
    
    POS = {(2,2):   ((1,1,0,1,1),),
           (5,):    ((1,1,1,1,1),),
           (1,1,1): ((1,0,1,0,1),),
           (1,3):   ((1,0,1,1,1),),
           (3,1):   ((1,1,1,0,1),),
           (4,):    ((1,1,1,1,0), (0,1,1,1,1)),
           (1,2):   ((1,0,0,1,1), (1,0,1,1,0), (0,1,0,1,1)),
           (2,1):   ((1,1,0,0,1), (1,1,0,1,0), (0,1,1,0,1)),
           (3,):    ((1,1,1,0,0), (0,1,1,1,0), (0,0,1,1,1)),
           (2,):    ((1,1,0,0,0), (0,1,1,0,0), (0,0,1,1,0), (0,0,0,1,1)),
           (1,):    ((1,0,0,0,0), (0,1,0,0,0), (0,0,1,0,0), (0,0,0,1,0), (0,0,0,0,1)),
           (1,1):   ((1,0,1,0,0), (1,0,0,1,0), (1,0,0,0,1), (0,1,0,1,0), (0,1,0,0,1), (0,0,1,0,1))}
    
    def __init__(self, clues): self.clues = {'V': clues[0], 'H': clues[1]}
    
    
    def solve(self):
        grid = { (d,z): list(self.POS[ self.clues[d][z] ]) for d in 'VH' for z in range(5)}
        
        changed = True
        while changed:
            changed = False
            
            for x in range(5):
                for y in range(5):
                
                    tupH, iH, tupV, iV = ('H',x), y, ('V',y), x
                    if len(grid[tupH]) == 1 and len(grid[tupV]) == 1: continue
                    
                    vH = { v[iH] for v in grid[tupH] }
                    vV = { v[iV] for v in grid[tupV] }
                    target = vH & vV
                    
                    if len(vH) == 2 and len(target) == 1:
                        changed = True
                        grid[tupH] = [t for t in grid[tupH] if t[iH] in target]
                        
                    if len(vV) == 2 and len(target) == 1:
                        changed = True
                        grid[tupV] = [t for t in grid[tupV] if t[iV] in target]
        
        return tuple( grid[('H',n)][0] for n in range(5) )