Lock in full 90-day FAANG roadmap access before Jan 14, 2026.
⌘K
Calculate Compressed Mean - Easy DSA Problem | Thita.ai
Calculate Compressed Mean
Difficulty: Easy
Category: DSA
Topics: Database
Asked at: Google, Amazon, Facebook, Microsoft
You are given a **0-indexed** integer array `nums`. To create the **compressed array**, repeatedly remove every pair of adjacent equal elements from `nums` until no such pairs remain. After compression, calculate the **mean** (average) of the elements in the resulting array.
Return the _mean of the compressed array as a floating-point number_. If the compressed array is empty, return `0.0`.