Contains Duplicate why this code Stack-Overflow?
<p>Here is the problem: </p>

<blockquote>
  <p>Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.</p>
</blockquote>

<p>Here is my code, but there is an error for stack-overflow:</p>

<pre><code>public static class Solution {
    public boolean containsDuplicate(int[] nums) {
        if (nums.length &lt; 1)
            return false;
        return recursion(nums, 0, nums.length - 1);
    }

    private static boolean recursion(int[] nums, int start, int end) {
        if ((end - start) == 0) {
            return true;

        }

        if ((end - start) == 1) {
            if (nums[start] == nums[end]) {
                return false;
            } else {
                return true;
            }
        }
        boolean first = recursion(nums, start, (end - start) / 2 - 1);
        boolean second = recursion(nums, (end - start) / 2, end);

        if (first == false || second == false) {
            return false;
        }
        return true;
    }
}
</code></pre>