<li>Delete the <strong>first</strong><code>i</code> letters of <code>s</code> if the first <code>i</code> letters of <code>s</code> are <strong>equal</strong> to the following <code>i</code> letters in <code>s</code>, for any <code>i</code> in the range <code>1 <= i <= s.length / 2</code>.</li>
</ul>
<p>For example, if <code>s = "ababc"</code>, then in one operation, you could delete the first two letters of <code>s</code> to get <code>"abc"</code>, since the first two letters of <code>s</code> and the following two letters of <code>s</code> are both equal to <code>"ab"</code>.</p>
<p>Return <em>the <strong>maximum</strong> number of operations needed to delete all of </em><code>s</code>.</p>
<strong>Input:</strong> s = "abcabcdabc"
<strong>Output:</strong> 2
<strong>Explanation:</strong>
- Delete the first 3 letters ("abc") since the next 3 letters are equal. Now, s = "abcdabc".
- Delete all the letters.
We used 2 operations so return 2. It can be proven that 2 is the maximum number of operations needed.
Note that in the second operation we cannot delete "abc" again because the next occurrence of "abc" does not happen in the next 3 letters.