Back to Type Challenges

README

questions/08767-medium-combination/README.md

latest1.9 KB
Original Source
<!--info-header-start--><h1>Combination </h1><blockquote><p>by Homyee King <a href="https://github.com/HomyeeKing" target="_blank">@HomyeeKing</a></p></blockquote><p><a href="https://tsch.js.org/8767/play" target="_blank"></a> </p><!--info-header-end-->

Given an array of strings, do Permutation & Combination. It's also useful for the prop types like video controlsList

ts
// expected to be `"foo" | "bar" | "baz" | "foo bar" | "foo bar baz" | "foo baz" | "foo baz bar" | "bar foo" | "bar foo baz" | "bar baz" | "bar baz foo" | "baz foo" | "baz foo bar" | "baz bar" | "baz bar foo"`
type Keys = Combination<['foo', 'bar', 'baz']>
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/8767/answer" target="_blank"></a> <a href="https://tsch.js.org/8767/solutions" target="_blank"></a> <hr><h3>Related Challenges</h3><a href="https://github.com/type-challenges/type-challenges/blob/main/questions/00296-medium-permutation/README.md" target="_blank"></a> <!--info-footer-end-->