Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3041. Maximize Consecutive Elements in an Array After Modification
Given an array where each element can be increased by at most 1, find the largest subset of elements that can be (after optional increments) sorted into a sequence of consecutive integers. The core challenge is picking which elements to increment and which integer interval to target to cover as many elements as possible, with up to 1e5 elements and values up to 1e6.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.