17. implement LastChar<T>

TypeScript
Is this helpful ?

  - accepted / - tried

Similar to FirstChar<T>, please implment LastChar<T> to get the last character.

type A = LastChar<'BFE'> // 'E'
type B = LastChar<'dev'> // 'v'
type C = LastChar<''> // never

Let's try to solve this problem within 5 minutes.

Discuss(8)