---
# System prepended metadata

title: Question 1

---

- You are given an array of 10 integers
- Each integer can be either 0 1 or 2
- Initially each element of the array is white

Your goal is to convert each element of the array black. In order to do so, you can perform operations of two types:

- pay one coin to choose a white element and paint it black
- choose a white element which is not equal to 0 and a black element adjacent to it, decrease the chosen white element by 1 , and paint the chosen white element black.

What is the minimum number of coins you have to spend to achieve your goal?

