Hint
reduce can build any shape — objects, maps, nested structures, not just numbers.
const chars = ['a', 'b', 'a', 'c', 'b', 'a'];
const counts = chars.reduce((acc, c) => {
acc[c] = (acc[c] || 0) + 1;
return acc;
}, {});
console.log(counts.a);
console.log(counts.b);3 2
Explanation: reduce builds a frequency map. a=3, b=2.
Key Insight: reduce can build any shape — objects, maps, nested structures, not just numbers.