[虚拟机OA]Build the Subsequences 生成子序列

Posted liuliu5151

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[虚拟机OA]Build the Subsequences 生成子序列相关的知识,希望对你有一定的参考价值。

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

 

题意:

给定一个字符串,输出该字符串中包含的所有子序列

 

思路:

 

代码:

 

以上是关于[虚拟机OA]Build the Subsequences 生成子序列的主要内容,如果未能解决你的问题,请参考以下文章

[虚拟机OA]Team Formation 2 团队构成

[虚拟机OA]Break a Palindrome 破坏回文串

[虚拟机OA]Fun with Anagrams 玩转同构词

[虚拟机OA]Group Anagram 变位词归类

[虚拟机OA]Maximal Square 最大正方形

[虚拟机OA]Even Subarray 最多含有K个奇数的子数组