An erasure code with k data shards and m parity shards can reconstruct the stripe from any k distinct shards.
Design ErasureStripeAnalyzer(dataShards, parityShards):
status is HEALTHY with all k+m shards, DEGRADED with at least k, otherwise LOST.failureMargin returns how many additional available shards may fail without losing readability: max(0, distinctAvailable - k).repairReads returns 0 when healthy, k when degraded, and -1 when lost.storageOverhead returns (k+m)/k, rounded to 5 decimals.
Shard IDs are in 0..k+m-1; duplicates may appear and count once.
Example 1:
Example 2:
Constraints
1 <= dataShards <= 100, 1 <= parityShards <= 1000 <= availableShards.length <= 10^4- Every shard ID is valid.