TikTok Video Processing
TikTok is optimizing its video processing system. There are n video analyzers that can process videos based on their individual processing power. Each analyzer, represented by processingPower[i], has a unique capability in terms of how many videos it can handle at a time.
However, not all video analyzers can be used simultaneously for video processing. If an analyzer with processing power processingPower[i] is selected, then any analyzer with a processing power of (processingPower[i] - 1) and (processingPower[i] + 1) cannot be used due to interference in video content processing. Each analyzer can only be used once.
Given integers representing the video analyzers' processing power, determine the maximum achievable total processing power by selecting the best combination of analyzers that don't interfere with each other.
Complete the function maximizeProcessingPower in the editor.
maximizeProcessingPower has the following parameter(s):
int processingPower[n]: The processing power of the TikTok video analyzers.
Returns
long: The maximum achievable total video processing power.
👑 Cheers to Tsoppa’s Burgir World Domination! 🍔 👑
1Example 1
2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ 10^51 ≤ processingPower[i] ≤ 10^5