Unusual Runtime Error


#1
string a="";
vector<string> Solution::wordBreak(string A, vector<string> &B) {
    a = A;
}

I am getting Runtime Error when I test this code.

string a="";
vector<string> Solution::wordBreak(string A, vector<string> &B) {
    a = A;
    return vector<string>();
}

I don’t get Runtime error for this