CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <set>
#include <vector>
using namespace std;
bool compare(const pair<int,int>& obj1,const pair<int,int>& obj2)
{
if (obj1.second != obj2.second)
return obj1.second < obj2.second;
return obj1.first < obj2.first;
}
/*
struct compare
{
bool operator()(const pair<int,int>& obj1,const pair<int,int>& obj2) const
{
if (obj1.second != obj2.second)
return obj1.second < obj2.second;
return obj1.first < obj2.first;
}
};
*/
vector<int> kWeakestRows(vector<vector<int>>& mat, int k)
{
vector<int> ans;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run