Back to Type Challenges

README

questions/08987-medium-subsequence/README.md

latest1.3 KB
Original Source
<!--info-header-start--><h1>Subsequence </h1><blockquote><p>by jiangshan <a href="https://github.com/jiangshanmeta" target="_blank">@jiangshanmeta</a></p></blockquote><p><a href="https://tsch.js.org/8987/play" target="_blank"></a> </p><!--info-header-end-->

Given an array of unique elements, return all possible subsequences.

A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements.

For example:

typescript
type A = Subsequence<[1, 2]> // [] | [1] | [2] | [1, 2]
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/8987/answer" target="_blank"></a> <a href="https://tsch.js.org/8987/solutions" target="_blank"></a> <!--info-footer-end-->