const solution = N =>{ let sum = 1; sign = -1; for(let i = 2; i <= N; i++){ sum += i * sign * ( i - 1 ); sign = sign === 1 ? -1:1; } return sum; }