Skip to content

Commit

Permalink
warmup lab soln
Browse files Browse the repository at this point in the history
  • Loading branch information
zapperfish committed Sep 17, 2024
1 parent 6374868 commit dbe48a1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions labs/misc/warmup/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
#include "solution.h"

int solution(int *arr, int N) {
int res = 0;
for (int i = 0; i < N; i++) {
res += arr[i];
}
return res;
return (N * (N + 1)) / 2;
}

0 comments on commit dbe48a1

Please sign in to comment.