type-challenges / type-challenges

Collection of TypeScript type challenges with online judge

Home Page:https://tsch.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

21106 - Combination key type

sunupupup opened this issue · comments

type Combs<T extends string[]> = T['length'] extends 0 | 1
  ? never
  : T extends [infer First, ...infer Rest extends string[]]
  ? `${First & string} ${Rest[number]}` | Combs<Rest>
  : never;