Search
⌘K

Leetcode 3618. Split Array by Prime Indices

Partition the array into two sums based on whether an element's 0-based index is a prime number, and return the absolute difference |sum(prime-index elements) - sum(other elements)|; the main challenge is efficiently identifying prime indices up to n−1 (n ≤ 1e5).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.