40. implement UnionToIntersection<T>

TypeScript

  - 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 minutes.