22 lines
370 B
C++
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;
|
|
|
|
}
|
|
};
|