Here is the complete fixed version of `solution.ts`:
```typescript
/** The factorial of n, or throw Error if n is negative or non-integer. */
export function factorial(n: number): number {
  if (n < 0 || !Number.isInteger(n)) {
    throw new Error('Argument must be a non-negative integer');
  }

  // Factorial of 0 is 1
  if (n === 0) {
    return 1;
  }

  return n * factorial(n - 1);
}
```