34. implement Repeat<T, C>

TypeScript
Is this helpful ?

  - accepted / - tried

Implement Repeat<T, C> to return a tuple by repeating.

type A = Repeat<number, 3> // [number, number, number]
type B = Repeat<string, 2> // [string, string]
type C = Repeat<1, 1> // [1, 1]
type D = Repeat<0, 0> // []

negative case of C could be ignored.

Let's try to solve this problem within 10 mintues.

Discuss(6)