# Maximum Sum of Nearly Unique Subarray (LeetCode 3170) Practice note for coding interviews. ## Approach DP on subsequences; roll arrays to save space. ## Complexity State time and space clearly; call out edge cases (empty input, duplicates, extremes). ## Practice tip Rehearse the explanation out loud. An [real-time AI interview assistant for live interviews](https://www.linkjob.ai/) helps keep structure under time pressure. Disclosure: personal study notes; I am affiliated with Linkjob AI.