Skip to content

Commit

Permalink
Task. An implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
5arnA committed Feb 4, 2024
1 parent 87c62ec commit 7e95ed4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions homework/generate-sequence/generateSequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
#include <vector>

std::vector<int> generateSequence(int count, int step) {
// TODO: Implement me :)
return {};
std::vector<int> sequence{};

if (count <= 0) {
return sequence;
}

for (auto i = step, j = 0; j < count; ++j, i += step) {
sequence.push_back(i);
}
return sequence;
}

0 comments on commit 7e95ed4

Please sign in to comment.