#include <utility>
bool correct(int *arr, int size) {
while (--size > 0)
if (arr[size - 1] > arr[size])
return true;
return false;
}
void shuffle(int *arr, int size) {
for (int i = 0; i < size; ++i)
std::swap(arr[i], arr[(rand() % size)]);
}
void bogoSort(int *arr, int size) {
while (correct(arr, size))
shuffle(arr, size);
}