Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 1.38 KB

File metadata and controls

12 lines (8 loc) · 1.38 KB

Unique medium #array

by Pineapple @Pineapple0919

Take the Challenge

Implement the type version of Lodash.uniq, Unique takes an Array T, returns the Array T without repeated values.

type Res = Unique<[1, 1, 2, 2, 3, 3]>; // expected to be [1, 2, 3]
type Res1 = Unique<[1, 2, 3, 4, 4, 5, 6, 7]>; // expected to be [1, 2, 3, 4, 5, 6, 7]
type Res2 = Unique<[1, "a", 2, "b", 2, "a"]>; // expected to be [1, "a", 2, "b"]

Back Share your Solutions Check out Solutions