How to Find the Sum of Prime-Indexed Elements in Go
The challenge
You will be given an integer array and your task is to return the sum of elements occupying prime-numbered indices.
The first element of the array is at index ``.
The solution in Golang
Option 1:
Option 2:
Option 3:
Test cases to validate our solution
|
|