Hi!
I was playing around with sorting algorithms and came up with this ideea ~~~~~
vector solve(vector a) { shuffle(a.begin(), a.end(), rng); int n = (int) a.size(); bool changes = 1; while (changes) { changes = 0; for (int x = 1; x <= n; x *= 2) { for (int i = 0; i + x < n; i++) { if (a[i + x] < a[i]) { swap(a[i], a[i + x]); changes = 1; } } } } return a; }
~~~~~