monorepo/App/Tests/Helpers.hh
2023-06-27 11:53:21 +03:00

22 lines
370 B
C++

#include <vector>
class Helpers {
public:
static bool is_sorted(std::vector<int> &arr)
{
int index = 0;
for (auto e : arr)
{
if(index == 0)
index++;
continue;
if(e < arr[index-1])
return false;
index++;
}
return true;
}
};