Hi,
let say my situation is the following. I have two vectors one of which is a vector of vectors:
in v1 contains index positions of vectors in v2:Code:vector<int> v1; vector<vector<int>> v2;
Code:v1: 0 1 2 3 v2: 0-> 8 5 6 4 2 1-> 7 6 2-> 81 1 91 9 1 1 2 3 54 1 3-> 1
what i need to do is to sort v2 according to the size of vectors in it v2[i].size() and accordingly v1 such that:
any clever solution to this problem ??Code:after sort: v2: 0-> 1 1-> 7 6 2-> 8 5 6 4 2 3-> 81 1 91 9 1 1 2 3 54 1 and v1: 3 1 0 2