We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/* * Complete the 'climbingLeaderboard' function below. * * The function is expected to return an INTEGER_ARRAY. * The function accepts following parameters: * 1. INTEGER_ARRAY ranked * 2. INTEGER_ARRAY player */void_print(constvector<int>&v){for(autoe:v){cout<<e<<" ";}cout<<endl;}vector<int>climbingLeaderboard(vector<int>ranked,vector<int>player){vector<int>rx;// _print(ranked);ranked.erase(std::unique(ranked.begin(),ranked.end()),ranked.end());// _print(ranked);for(autop:player){autoit=lower_bound(ranked.begin(),ranked.end(),p,std::greater<int>());autok=distance(ranked.begin(),it);rx.push_back(k+1);}returnrx;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →