32. implement RepeatString<T, C>
Share
- accepted / - tried
Similar to String.prototype.repeat()
, implement RepeatString<T, C>
to create a new type by repeating string T
for C
times.
type A = RepeatString<'a', 3> // 'aaa'type B = RepeatString<'a', 0> // ''
There is no need to handle negative case of C.