I'm starting solving problem on leetcode, this problem didn't pass the test cases, this my try:

```
function checkIfExist($arr) {

    $i = 0;
    $j = 0;
    $n = count($arr);

    // loop over the array
    for($i; $i < $n; $i++) {
        for($j; $j < $n; $j++) {    
            // check if element of i and j not the same and N*2 = M
            if ($i != $j && $arr[$i] * 2 == $arr[$j]) {
                return true;
            }
        }
    }
    return false;
}

```

Can please explain to me where I did the error here?