This is from one of the problems in the tutorials at leetcode, it asks:

Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 \* M).

Here's my attempted solution:

```
class Solution {
public:
    bool checkIfExist(vector<int>& arr) {
        for(int i = 0; i < arr.size(); i++){
            for(int j = 0; j < i; j++){
            if (arr[i] == 2*arr[j]){
                return true;}
        }
    }
}
};

```

I end up getting the error:

```
Line 10: Char 1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
}
^
1 error generated.

```

What am I doing wrong here?

Edit:
I fixed the bug by adding the return false statement as suggested, and also fixed the loop on j to run till arr.size(). However leetcode still won't accept my solution. It passes the compile test, but not the submission:
[![error](https://i.stack.imgur.com/doZWa.png)](https://i.stack.imgur.com/doZWa.png)

What's up with that now? Is it not recognizing the negative values in the array? Sorry if these are very silly questions, I'm rather new to programming in general, feel like I should've mentioned this.