Leetcode 3569. Maximize Count of Distinct Primes After Split
After each point update, treat each prime value as an interval [min_index, max_index] of its occurrences; the sum of distinct primes in prefix+suffix for split k equals total distinct primes plus the number of prime-intervals covering k, so the core challenge is to support dynamic interval add/remove and quickly find the k with maximum interval overlap (range-add / range-max structure) across queries.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.