Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 1.49 KB

File metadata and controls

13 lines (8 loc) · 1.49 KB

LastIndexOf medium #array

by jiangshan @jiangshanmeta

Take the Challenge    简体中文

Implement the type version of Array.lastIndexOf, LastIndexOf<T, U> takes an Array T, any U and returns the index of the last U in Array T

For example:

type Res1 = LastIndexOf<[1, 2, 3, 2, 1], 2> // 3
type Res2 = LastIndexOf<[0, 0, 0], 2> // -1

Back Share your Solutions Check out Solutions