00533-easy-concat

Back

type TupleOrArray = any[] | readonly any[];
type Concat<T extends TupleOrArray, U extends TupleOrArray> = [...T, ...U];

Solution by pofigrist #35855

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

Solution by song4613107 #35792

type Concat<C extends any[], T extends any[]> = [...C, ...T];

Solution by Sensuele #35777

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

Solution by XenoPOMP #35742

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

Solution by ndwgg #35546

type Concat<T extends Array<unknown> | ReadonlyArray<unknown>, U extends Array<unknown> | ReadonlyArray<unknown>> = [...T, ...U]

Solution by gangnamssal #35486

type Concat<T extends readonly (PropertyKey| boolean)[], U extends readonly (PropertyKey| boolean)[]> =  [...T, ...U]

Solution by RanungPark #35438

// your answers

type Result<T extends unknown[], K extends unknown[]> = [...T, ...K];

const slicedData: Result<[1], [2]> = [1, 2];

Solution by Sathiyapramod #35416

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

Solution by sesolaga #35393

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

Solution by gyeounjeong #35359

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

Solution by HoseaGuo #35130

// 你的答案

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

Solution by hexingdagmail #35050

type Tuple = readonly unknown[]
type Concat<T extends Tuple, P extends Tuple> = [...T, ...P]

Solution by ClarityOfMind #34992

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

Solution by huabingjenny #34981

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

Solution by raeyoung-kim #34941

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

Solution by 56aiden90 #34881

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

Solution by floatDreamWithSong #34870

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

Solution by nguyste #34856

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

Solution by eunsukimme #34814

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

Solution by kang-kibong #34747

type Concat<T extends any[]|readonly any[], U extends any[]|readonly any[]> = [...T,...U];

Solution by lephuthuc2001 #34712

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

Solution by zeyuanHong0 #34707

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

Solution by Git-I985 #34704

type Concat<T, U> = T extends readonly any[] ? U extends readonly any[] ? [...T, ...U] : never : never

Solution by nathan2slime #34661

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

Solution by Hailey0930 #34637

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

Solution by devshinthant #34547

// your answers

Solution by devshinthant #34546

// 여기 풀이를 입력하세요
type Concat<T extends readonly unknown[], U extends readonly unknown[]> = [...T, ...U];

Solution by LeeKangHyun #34462

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

// Note that: readonly is only permitted on array and tuple literal types ⇒ it means that it doesn’t work with generic like Array<unknown>

Solution by binhdv155127 #34443

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

Solution by ktim816 #34425