Deloitte | PWC | ATS resumes | Wipro | Infosys | Accenture | Capegemini | job links
Open in Telegram
WhatsApp group link https://chat.whatsapp.com/Il915UNLpw32YjwxFf8D63
Show more4 673
Subscribers
No data24 hours
-17 days
-630 days
Posts Archive
#include<bits/stdc++.h>
using namespace std;
vector<int> rankSongs(vector<vector<int>> pref) {
Ā Ā Ā int n = pref.size();
Ā Ā Ā int m = pref[0].size();
Ā Ā Ā vector<vector<int>> b(m, vector<int>(m, 0));
Ā Ā Ā vector<int> w(m, 0), r(m);
Ā Ā Ā iota(r.begin(), r.end(), 0);
Ā Ā Ā for (int i = 0; i < n; i++) {
Ā Ā Ā Ā Ā Ā Ā for (int j = 0; j < m; j++) {
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā for (int k = j + 1; k < m; k++) {
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā b[pref[i][j]][pref[i][k]]++;
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā }
Ā Ā Ā Ā Ā Ā Ā }
Ā Ā Ā }
Ā Ā Ā for (int i = 0; i < m; i++) {
Ā Ā Ā Ā Ā Ā Ā for (int j = 0; j < m; j++) {
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā if (i != j && (b[i][j] > b[j][i] || (b[i][j] == b[j][i] && i < j))) {
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā w[i]++;
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā }
Ā Ā Ā Ā Ā Ā Ā }
Ā Ā Ā }
Ā Ā Ā sort(r.begin(), r.end(), [&](int i, int j) {
Ā Ā Ā Ā Ā Ā Ā return w[i] > w[j] || (w[i] == w[j] && i < j);
Ā Ā Ā });
Ā Ā Ā return r;
}
int main() {
Ā Ā Ā int n, m;
Ā Ā Ā cin >> n >> m;
Ā Ā Ā vector<vector<int>> p(n, vector<int>(m));
Ā Ā Ā for (int i = 0; i < n; i++) {
Ā Ā Ā Ā Ā Ā Ā for (int j = 0; j < m; j++) {
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā cin >> p[i][j];
Ā Ā Ā Ā Ā Ā Ā }
Ā Ā Ā }
Ā Ā Ā vector<int> r = rankSongs(p);
Ā Ā Ā for (int i = 0; i < m; i++) {
Ā Ā Ā Ā Ā Ā Ā cout << r[i] << endl;
Ā Ā Ā }
Ā Ā Ā cout << endl;
Ā Ā Ā return 0;
}
Company name : MEESHO
Role : BUSINESS ANALYST
Package : 4.8 Lpa
APPLY LINK :- https://docs.google.com/forms/d/e/1FAIpQLSc3DvqJDjZeYjFZX2OgVPwm5shjCX4a0APzYBaTBoPzTf4khg/viewform?pli=1
While applying make sure in your CV mention python and sql.
After you getting exam link contact us, we will help you
Mitosogo ibm exams help available
Meesho
Tech Mahindra
IBM
Help available
Any Other Oncampus/ Offcampus Exam
100% Clearance Guarantee.
Contact @PlacementsBroš
Meesho is hiringā¤ļø
Apply guys
https://t.me/Coding_palace/6566
IBM exam clearedā
Got mail for next round
https://t.me/Coding_palace/6570
100 percent clearanceā
-->@placementsBroš
IBM help availableā
Ibm exam help available ā
Register and Utilize this guy's š
Discover the magic of Python in Data Science! š
Witness a live demonstration showcasing its capabilities. Don't miss out! šš
ā1 day left ā
Register Now for Free:
https://bit.ly/47KtVSN
