Skip to content

Commit

Permalink
adding works
Browse files Browse the repository at this point in the history
  • Loading branch information
MiKaz003 committed Aug 3, 2024
1 parent e826226 commit f61718b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions homework/max-of-vector/maxOfVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#include <vector>

int maxOfVector(const std::vector<int>& vec) {
// TODO: Implement me :)
return {};
int max = *vec.begin();
for (auto el : vec){
if (el > max){
max = el;
}
}
return max;
}

0 comments on commit f61718b

Please sign in to comment.