Practice ยท 4 of 5
Count the peaks
CHALLENGE
Difficulty: advanced+25 XP
A cell is a **peak** if its value is strictly greater than the **average of its existing neighbors** (the in-bounds 8 neighbors โ corners have 3, edges have 5; the cell itself never counts). Count the peaks. Implement process(int[][] g).
Example: {{9,1},{1,1}} โ 1.
Press Submit to check your solution.
Back to lesson: Practice: Grid lab: axes, neighborhoods, walls