[–] Sianko 1y ago ↗ I think the value of a repeated number can be found much easier: ``` long sum = 0; for (int i = 0; i < n; i++) { if(i < n - 1) { sum -= i; } sum += array[i]; }printf("Element %d\r\n", sum); ``` [–] assafk 1y ago ↗ This doesn't work if more than one value repeats itself.
2 comments
[ 1.8 ms ] story [ 18.4 ms ] threadprintf("Element %d\r\n", sum); ```