Data structure train departure
no vote
At every moment, the train can enter the exit from the entrance station or directly from the entrance, or enter the exit from the station. Now there are some cars waiting at the entrance, they have to come out of the exit in the above way, now you have to count all the possible outbound sequences. For example, when the entry is ABC, the possible outbound sequences are ABC, ACB, BAC, BCA, CBA [input] a string and the inbound sequence. [output] & nbsp; & nbsp; & nbsp; all possible outbound sequences are arranged from small to large in dictionary order. &Each line of sample input: & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; ABC