40. implement UnionToIntersection<T>

TypeScript
Is this helpful ?

  - accepted / - tried

Implement UnionToIntersection<T> to get an Intersection type from Union type.

type A = UnionToIntersection<{a: string} | {b: string} | {c: string}> 
// {a: string} & {b: string} & {c: string}

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

Discuss(4)