---
# System prepended metadata

title: Case

---

# Case
![](https://i.imgur.com/Pb9oxbO.png)



# Coding
![](https://i.imgur.com/3S8XAhg.png)

```python
def checkpin(pin):
//check 0 ist falsche Eingabe
//check 1 ist richtige
    check1 = 0
    check2 = 0
    for i in range(1,3):
        if(pin[0]!=pin[i]):
            check1 = 1
            break

    for i in range(1,3):
        if(pin[i-1] != (pin[i]-1)):
            check2 = 1
            break
 
 if((check1 + check2) == 2)
     return 1
 else
     return 0


arr = [0, 0, 0, 0] => 0
arr = [1, 2, 3, 4] => 0
arr = [1, 2, 0, 0] => 1
checkpin(arr)
        
```

