A subsequence of a string is obtained by deleting zero or more characters from the string while maintaining order. For example, the subsequences of string s = "xyz", not including the empty string, are "x", "xy", "xz", "xyz", "y", "yz", and "z". You will generate an array of all subsequences of a given string, omitting the empty string.
Function Description
Complete the function buildSubsequences in the editor below. The function must return an array of strings comprising all subsequences of the given string sorted alphabetically, ascending. Do not include the empty string in your results.
buildSubsequences has the following parameter(s):
s: the string to process
题意:
给定一个字符串,输出该字符串中包含的所有子序列
思路:
代码:
原文地址:https://www.cnblogs.com/liuliu5151/p/11509806.html