给定一个字符串string A和其长度n,返回所有该字符串所包含字符的各种排列。要求输入字符串长度小于等于11且均为大写英文字符,排列中的字符串按字典序从大到小排序。(重复字符串不用合并) 测试样例: "ABC" 返回:["CBA","CAB","BCA","BAC","ACB","ABC"]
加载中...
import java.util.*; public class Permutation { public ArrayList
getPermutation(String A) { // write code here } }
class Permutation { public: vector
getPermutation(string A) { // write code here } };
# -*- coding:utf-8 -*- class Permutation: # A是一个字符串 def getPermutation(self, A): # write code here
using System.Collections.Generic; class Permutation { public List
getPermutation(string A) { // write code here } }