Question: Goldman Sachs , Recent Online Assessment Questions (3rd August 2023) | Autocorrect Prototype | Preprocess Dates
1
Entering edit mode

ADD COMMENTlink 15 months ago PoGo 2.4k
0
Entering edit mode

Question 1 solution

vector<vector<string>> sol(vector<string> w,vector<string> q)
{
    map<string,vector<string>> mp;
    for(auto i:w)
    {
        string j=i;
        sort(j.begin(),j.end());
        mp[j].push_back(i);
    }
    vector<vector<string>> ans;
    for(auto i:q)
    {
       string j=i;
       sort(j.begin(),j.end());
    sort(mp[j].begin(),mp[j].end());
    ans.pb(mp[j]);
    }
    return ans;
}

 

ADD COMMENTlink 15 months ago suryansh jaiswal • 370
0
Entering edit mode

hello

 

 

ADD COMMENTlink 5 months ago Vijay Kuswah • 0
0
Entering edit mode

hello

 

ADD COMMENTlink 5 months ago Vijay Kuswah • 0

Login before adding your answer.

Similar Posts
Loading Similar Posts