<p>You are given a <strong>0-indexed</strong> array <code>nums</code> consisting of <code>n</code> positive integers.</p>
<p>The array <code>nums</code> is called <strong>alternating</strong> if:</p>
<ul>
<li><code>nums[i - 2] == nums[i]</code>, where <code>2 <= i <= n - 1</code>.</li>
<li><code>nums[i - 1] != nums[i]</code>, where <code>1 <= i <= n - 1</code>.</li>
</ul>
<p>In one <strong>operation</strong>, you can choose an index <code>i</code> and <strong>change</strong><code>nums[i]</code> into <strong>any</strong> positive integer.</p>
<p>Return <em>the <strong>minimum number of operations</strong> required to make the array alternating</em>.</p>
One way to make the array alternating is by converting it to [1,2,<u><strong>1</strong></u>,2,<u><strong>1</strong></u>].
The number of operations required in this case is 2.
Note that the array cannot be converted to [<u><strong>2</strong></u>,2,2,2,2] because in this case nums[0] == nums[1] which violates the conditions of an alternating array.