Sum of all prime factors of elements of array modulo
Answers
Answered by
0
- here modulo is to be as array.
- The idea is to first calculate the least prime factor till maximum element of the array with Prime Factorization using Sieve.
- Now, Iterate the array and for an element arr[i] If arr[i] != 1: Else update sum = sum + originalVal(arr[i]).
- Print the sum in the end.
Similar questions