Skip to main content

Checkpoint: does each element beat the suffix?

Challenge on lesson: Checkpoint: suffix dominance

CHALLENGE
Difficulty: advanced+25 XP

Count positions i where arr[i] is **strictly greater than the sum of all elements after i**. Implement process(int[] arr) (0 for empty). Example: {3, 1, 2} โ†’ positions: 3>3? no; 1>2? no; 2>0 (nothing after)? yes โ†’ 1.

Back to lesson: Checkpoint: suffix dominance