Ad
  • Custom User Avatar

    Your code is not a correct solution for this problem. Your type declaration is not a valid TypeScript type (it is not allowed to write M + 1 for generic parameters). It passes Sample Tests because the TypeScript Codewars setup is very lenient and it allows incorrect types by replacing them with Any. Real tests are much stricter and that's why your solution fails them.

    I improved Sample Tests (now your solution does not pass them).