Added helper for vector-stats

This commit is contained in:
Ruakij 2021-11-22 13:29:39 +01:00
parent 5ea6d1f975
commit bbd9623256

15
helper/vector-stats.hpp Normal file
View File

@ -0,0 +1,15 @@
#ifndef C437A277_1F23_496D_9B69_A21D771ECA91
#define C437A277_1F23_496D_9B69_A21D771ECA91
#include <vector>
#include <limits.h>
int max(std::vector<int> vec){
int max = INT_MIN;
for(int i=0; i<vec.size(); ++i){
if(vec[i] > max) max = vec[i];
}
return max;
}
#endif /* C437A277_1F23_496D_9B69_A21D771ECA91 */