Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Build the Sub-sequences

Home > Programs > Strings

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.

Example
For example, the subsequences of string s = "xyz", not including the empty string, are "x", "xy", "xz", "xyz", "y", "yz", and "z"

Function Description:
Complete the function builds sequences in the editor below.

buildSubsequences has the following parameter(s)
str s: the string to process

Returns:
str[]: An array of strings comprising all the subsequences of the given string sorted alphabetically, ascending.

constraints:
1 < length of s <16
s is a string of distinct lowercase English alphabetic letter ascii[a-z]

Show Full Paragraph

Answer:


Asked In :: SAP Labs HackerRank

Post Your Answer Here: