Build the Sub-sequences
377 / 59
Build the Subsequences
A subsequence of a string is obtained by deleting zero or more characters from the string while maintaining order. Given a string, generate an array of all subsequences sorted alphabetically ascending, omitting the empty string.
For example, the subsequences of string s = "xyz", not including the empty string, are "x", "xy", "xz", "xyz", "y", "yz", and "z"
Complete the function builds sequences in the editor below.
buildSubsequences has the following parameter(s)
str s: the string to process
str: An array of strings comprising all the subsequences of the given string sorted alphabetically, ascending.
1 < length of s <16
s is a string of distinct lowercase English alphabetic letter ascii[a-z]
Show Full Paragraph