Maximize Engagement
Maximize Engagement is a TikTok coding interview problem. You’re given two equal-length arrays, views and likes. The views array is fixed, but you may rearrange likes. The engagement score equals the sum of likes[i] for indices where likes[i] > views[i]. Determine the highest possible engagement score by reordering likes and return that value. This interview question from TikTok focuses on understanding array relationships and optimizing the defined metric under given constraints.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
