Ice Cream Parlor

  • + 0 comments
    vector<int> icecreamParlor(int m, vector<int> arr) {
        int n=arr.size(); vector<int> index;
        for(int i=0; i<n-1; i++){
            for(int j=i+1; j<n; j++){
                if(arr[i]+arr[j]==m){
                    index.push_back(i+1);
                    index.push_back(j+1);
                    return index;
                }
            }
        }
        
        return index;
    }