码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-09-12 09:56:59      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:builds   mit   子序列   har   代码   输出   思路   example   fun   

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 生成子序列

标签:builds   mit   子序列   har   代码   输出   思路   example   fun   

原文地址:https://www.cnblogs.com/liuliu5151/p/11509806.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!