## Question:

It should be done in a productive way without loops. Original vector:

`arr = np.array([True, True, False, True, True, False, False, False, True, True, True, False, True])`

Expected Result:

`[ True False False True False False False False True False False False True]`

An example of a solution with a loop:

```
import numpy as np
arr = np.array([True, True, False, True, True, False, False, False, True, True, True, False, True])
res = np.full_like(arr, fill_value=False)
for i in range(0, len(arr)):
if i > 0:
if not arr[i - 1] and arr[i]:
res[i] = True
elif arr[i]:
res[i] = True
print(arr)
print(res)
# [ True True False True True False False False True True True False True]
# [ True False False True False False False False True False False False True]
```

## Answer:

You don't even need to explain anything, it's so beautiful:

```
a[1:][a[:-1] & a[1:]] = False
```