Computer Science, asked by rutikshagaonkar8940, 11 months ago

Sum of all prime factors of elements of array modulo

Answers

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