03060-easy-unshift

Back

type Unshift<T extends any[], U> = [U, ...T]

Solution by Kolufs #33531

// 你的答案
type Unshift<T extends readonly any[], U> = [U, ...T]

Solution by chenjieya #33402

// 여기 풀이를 입력하세요
type Tuple = unknown[];

type Unshift<T extends Tuple, U> = [U, ...T];

Solution by awesomelon #33371

type Unshift<T extends unknown[], U> = [U,...T]

Solution by Skytim #33315

type Unshift<T extends any[], U> = [...[U],...T]

Solution by mrchenxiao #33229

type Unshift<T extends unknown[], U> = [U, ...T]

Solution by loevray #33198

type Unshift<T extends readonly PropertyKey[], U> = [U, ...T]

type Result = Unshift<[1, 2], 0> // [0, 1, 2,]

Solution by ryota658 #33067

type Unshift<T extends any[], U> = [U, ...T]

Solution by RanungPark #33050

type Unshift<T extends any[], U> = [U, ...T]

// 你的答案

Solution by DwayneDuanJY #33019

// 与push 相反
type Unshift<T extends any[], U> = [U, ...T]

Solution by CAN1177 #32849

type Unshift<T extends any[], U> = [U, ...T]

Solution by ZhipengYang0605 #32789

type Unshift<T extends any[], U> = [U,...T];

Solution by Yasunori-aloha #32773

type Unshift<T, U> = T extends [...infer Rest] ? [U, ...Rest] : [U];

Solution by aiomonitors #32680

// your answers
type Unshift<T extends unknown[], U> = [U, ...T]

Solution by Ohjaeyeop #32478

type Unshift<T extends unknown[], U> = [U, ...T]

Solution by jcyicai #32444

// 你的答案
type Unshift<T extends unknown[], U> = [U,...T]

Solution by DOIT008 #32407

type Unshift<T extends unknown[], U> = [U, ...T];

Solution by HA-SEUNG-JEONG #32188

type Unshift<T extends unknown[], U> = [U, ...T]

Solution by wjdalsths #32164

type Unshift<T extends readonly unknown[], U> = [U, ...T]

Solution by dev-hobin #32149

type Unshift<T extends readonly any[], U> = [U, ...T]

Same logic used in #32133 but we firstly add the last element U, then the spread T

Solution by joyanedel #32134

// your answers
type Unshift<T extends Array<unknown>, U> = [U, ...T]

Solution by Rustamaha #32071

type Unshift<T extends readonly any [], U> = [U, ...T]

Solution by asherthechamp #31865

type Unshift<T extends any[], U> = [U,...T]

Solution by kimud6003 #31837

// 解答をここに記入
type Unshift<T extends readonly any[], U extends any> = [U,...T]

Solution by pea-sys #31728

type Result = Unshift<[1, 2], 0> // [0, 1, 2,]

type Unshift<T extends unknown[], U> = [U, ...T]

Solution by anovicenko74 #31723

type Unshift<T extends any[], U> = [U, ...T]

Solution by kai-phan #31602

type MyArray = any[]
type Unshift<T extends MyArray, U> = [U, ...T]

Solution by t-okazaki-biz #31466

// your answers
type Unshift<T extends unknown[], U> = [U, ...T];

Solution by yuisato1025 #31397

// your answers
type Unshift<T extends any[], U> = [U, ...T]

Solution by AhmedRagabKamal #31374

type Unshift<T extends any[], U> = [U, ...T]

Solution by onishi-kohei #31354