add test coverage and fix input

This commit is contained in:
Ilya Grigorev
2024-10-08 00:57:25 +05:00
parent bf714eed92
commit 8007275709
9 changed files with 389 additions and 244 deletions
+2 -1
View File
@@ -26,7 +26,8 @@ int min_index_positive(Vector vector) {
++i;
}
if (i >= vector.size()) {
throw std::runtime_error("No positive min found");
// No positive value found -> iterations stop
return -1;
}
int temp_index = i;
double temp = vector[i];