Shift
提出詳細
type Shift<T extends readonly unknown[]> = T extends [infer T1, ...infer T2] ? T2 : []
提出日時 | 2023-09-15 14:05:54 |
---|---|
問題 | Shift |
ユーザー | sankantsu |
ステータス | Accepted |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<Shift<[3, 2, 1]>, [2, 1]>>, Expect<Equal<Shift<['a', 'b', 'c', 'd' ]>, ['b', 'c', 'd']>>, ]