mirror of
https://github.com/type-challenges/type-challenges.git
synced 2025-12-08 19:06:13 +00:00
* feat(question): add tuple length * Update questions/18-easy-tuple-length/info.yml Accept suggestion Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com> * refactor(question): add tags tuple Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Tuple length

by sinoon @sinoon
For given a tuple, you need create a generic Length, pick the length of the tuple
For example
type tesla = ['tesla', 'model 3', 'model X', 'model Y']
type spaceX = ['FALCON 9', 'FALCON HEAVY', 'DRAGON', 'STARSHIP', 'HUMAN SPACEFLIGHT']
type teslaLength = Length<tesla> // expected 4
type spaceXLength = Length<spaceX> // expected 5