const initializeArrayWithValues = (n, val = 0) => Array(n).fill(val);