From bbd96232563d53ef657de4b12ec8a493c537908d Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 22 Nov 2021 13:29:39 +0100 Subject: [PATCH] Added helper for vector-stats --- helper/vector-stats.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 helper/vector-stats.hpp diff --git a/helper/vector-stats.hpp b/helper/vector-stats.hpp new file mode 100644 index 0000000..abec174 --- /dev/null +++ b/helper/vector-stats.hpp @@ -0,0 +1,15 @@ +#ifndef C437A277_1F23_496D_9B69_A21D771ECA91 +#define C437A277_1F23_496D_9B69_A21D771ECA91 + +#include +#include + +int max(std::vector vec){ + int max = INT_MIN; + for(int i=0; i max) max = vec[i]; + } + return max; +} + +#endif /* C437A277_1F23_496D_9B69_A21D771ECA91 */