I have array of 0's and 1's. And I need a function which return 'next' array. Something like this:

```
f([0,0,0,0]) -> [0,0,0,1]
f([0,0,0,1]) -> [0,0,1,0]
f([0,1,1,1]) -> [1,0,0,0]

```

Is there any library function or do I need to coding it myself ?