Tìm tất cả các hoán vị của Chuỗi - leetcode

Hoán vị còn được gọi là “số sắp xếp” hoặc “thứ tự”, là sự sắp xếp lại các phần tử của danh sách có thứ tự S thành một tương ứng một đối một với chính S. Xâu có độ dài N có N. hoán vị.  

ví dụ

Đầu vào. S = “ABC”
Đầu ra. “ABC”, “ACB”, “BAC”, “BCA”, “CBA”, “CAB”

Đầu vào. S = “XY”
Đầu ra. “XY”, “YX”

Đề nghị thực hành

Hoán vị của một chuỗi đã cho

Thử nó

In các hoán vị của một chuỗi đã cho bằng cách sử dụng quay lui

Thực hiện theo các bước đã cho để giải quyết vấn đề

  • Tạo hàm permute[] với các tham số là chuỗi đầu vào, chỉ số đầu chuỗi, chỉ số kết thúc chuỗi
  • Gọi hàm này với các giá trị chuỗi đầu vào, 0, kích thước của chuỗi – 1
    • Trong hàm này, nếu giá trị của  L và R giống nhau thì in ra cùng một chuỗi
      • Khác chạy vòng lặp for từ L đến R và hoán đổi phần tử hiện tại trong vòng lặp for với inputString[L]
      • Sau đó gọi lại hàm này bằng cách tăng giá trị của L lên 1
      • Sau đó, hoán đổi lại các giá trị đã hoán đổi trước đó để bắt đầu quay lui

Dưới đây là việc thực hiện các phương pháp trên

C++14




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
09

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
10

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
11

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
12
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
13
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
14

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
15

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
16

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
2

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
4
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
6
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
8

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
091

________ 2090 ________ 2093 ________ 2094

________ 2095 ________ 2096

________ 2090 ________ 2098 ________ 09

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
101

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
106

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
108

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
110

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
112

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
114

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
116

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
110

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
124

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
126

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
129____2130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
134

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
136

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
138

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
141

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
143

C




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
144

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
145

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
146

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
147

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
148

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
150____2151____2152
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
154

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
158

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
160

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
162

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
164

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
166

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
167

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
168

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
169

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
00

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
02____2151____004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
6
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
8

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
12

________ 2090 ________ 2093 ________ 2094

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
17
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
19
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
20

________ 2090 ________ 2098 ________ 09

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
26

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
28

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
114

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
28
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
116

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
39

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
126

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
45____2130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
50
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
51
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
52

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
138

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
141

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

Java




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
59

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
60

________ 061 ________ 062 ________ 063

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
136

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
70

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
74
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
79

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
81
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
82
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
83

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
85
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
87
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
88
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
93

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
95

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
97

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
99

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0901

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0903

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0905
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0907
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
6
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
8

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
094

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0918

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
098
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
106

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927____20928

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0930____088
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0932

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927____20928

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
93

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0944

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0946

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0948

_______094____20950

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0952

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0903

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0957
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0959
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0961

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
158

________ 2095 ________ 2151 ________ 20969

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0971

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0973

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0975

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0978

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0982

Python3




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0983

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0984

 

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0985
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0986
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0987
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0988

________ 2090

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140 _______ 20991 ________ 20987
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0993

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0994

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0995

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0996

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0997

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0998

 

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0985
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1000

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1003
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1006

________ 2095 ________ 21008 ________ 21009

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
098
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1012

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1015
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1016
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1017
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1018

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1020
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1022

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1024
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1025
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
88
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1027

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1020
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1031
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1032

 

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1033

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1034
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1037
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1039
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1040

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1041
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1043
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1040

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1045

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1046
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1048

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1049

C#




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1050

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1051

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
12
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1053

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
62
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1055

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
93

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
95

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1061

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1063

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
99

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0901

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0903

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0905
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0907
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
6
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
8

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
094

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1085

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
098
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
106

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927____20928

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1097

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927____20928

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
93

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0944

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0946

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0948

_______094____20950

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0952

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0903

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0957
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0959
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0961

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
158

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151____21135

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0971

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0973

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0975

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1034
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1144
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
82
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1034
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1147

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1150

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
124

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1159

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
74
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1168

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
138

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1174

PHP




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1175

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1176

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1051

 

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
93

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
95

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1061

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1181

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
99

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0901

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0903

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1185
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
02____21187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1189
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1191
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0993

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093 ________ 2104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1189 ________ 21198
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1191 ________ 20993

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1202
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1204
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1205
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
098

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1189
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1219
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1191
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1223

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1228
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1189
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
02
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1189
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1240
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1191
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1228
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1189
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
93

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0944

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0946

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0948

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0950

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0952

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0903

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1185
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
150
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1266
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1188
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1270
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0993

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1274
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1277
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1279
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1266
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1274
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1277
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1287
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1289

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1277
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1287
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1214
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1294
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1277
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1287
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1270
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1298

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1277____21287
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1270
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1294
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1274
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1308
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1277
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
124

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1317
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
51____2104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
02
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1187
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1325
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1317
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1327

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1328

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1329

Javascript




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1330

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1331

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
60

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1185
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1334

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

________ 2090 ________ 2093 ________ 2094

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1340
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1341
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

________ 2095 ________ 2098

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1349

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927____20928

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1097

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0927____20928

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1185
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1364

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1367

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1368
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1369____089

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1371

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0973

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0975

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1375
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1369
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1379
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1382

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1383

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1384

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1385

Đầu ra

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
53

Độ phức tạp về thời gian. O[N * N. ] Lưu ý rằng có N. hoán vị và nó yêu cầu thời gian O[N] để in một hoán vị.
Không gian phụ. O[R – L]

Ghi chú. Giải pháp trên in các hoán vị trùng lặp nếu có các ký tự lặp lại trong chuỗi đầu vào. Vui lòng xem liên kết bên dưới để biết giải pháp chỉ in các hoán vị riêng biệt ngay cả khi có các bản sao trong đầu vào

  • In tất cả các hoán vị riêng biệt của một chuỗi đã cho với các bản sao.  
  • Hoán vị của một chuỗi đã cho bằng STL

Một cách tiếp cận khác bằng cách nối các chuỗi con.  

Thực hiện theo ý tưởng dưới đây

  • Tạo một hàm đệ quy và chuyển chuỗi đầu vào và một chuỗi lưu trữ hoán vị [ban đầu trống khi được gọi từ hàm chính]
  • Nếu độ dài của chuỗi là 0, hãy in hoán vị
  • Nếu không, hãy chạy một vòng lặp từ i = 0 đến N
    • Coi S[i], là một phần của hoán vị
    • Xóa phần này khỏi chuỗi hiện tại và nối nó vào cuối hoán vị
    • Gọi hàm đệ quy với chuỗi hiện tại không chứa S[i] và hoán vị hiện tại

Dưới đây là việc thực hiện phương pháp này

C++




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1386

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
11

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
12
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
13
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
14

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1392

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

________ 2090 ________ 2093 ________ 21396

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1398
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1399
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1410

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1413

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1415

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1417

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1419

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1421

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1425

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
126

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1430
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1434
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1369
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1438
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1439
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1442

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
141

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

Java




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1447
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1448

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
62
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1055

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1454

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1459
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1461

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1463
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1399
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1475
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1477

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1480

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1482
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1484

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1486
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
88
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1490

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1421

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1425

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1503

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1507____082
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1509

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1511____2130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1515
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1369
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1519____21439
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1442

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1527

Python3




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0985
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1529

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1039
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1534
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0988

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1008
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1541
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1399
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0993

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1015
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1016
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1017
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1039
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1554

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1556
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1558

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1560____21004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1562
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
86
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1564

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1566______21004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1568
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1025
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
88
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1571

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1573____21004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1560
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1025
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1566

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1579____21025
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1581

 

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1582

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1583____21004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1369

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1586
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1004
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
130

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1008
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1591
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
0993

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1593

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1594

C#




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
12
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1053

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
62
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1055

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1454

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
093
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1608

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1610
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1399
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
140
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
104
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
5
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1622

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
151
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1413

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1627

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1629

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1490

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
107
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1421

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1425

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
61
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
68
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
3
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1644

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1511____2130
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1515
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1369
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
131

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1656____21439
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1442

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1664

Javascript




All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1330

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1667

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1669

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1185
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1671

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1672

________ 2090 ________ 2093 ________ 21675

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1679
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1399
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
89

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
103____21687

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
9

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1691

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1693

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1695

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1697

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
095
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1421

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
120

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
004

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
006______0007

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
009____0007

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
013____0014
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
015

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
94

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
013____0019

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
090
All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1442

 

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
022

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  
1385

Đầu ra

All possible strings are : ABC  ACB  BAC  BCA  CAB  CBA  

Độ phức tạp về thời gian. O[N * N. ] tôi. e. có N. hoán vị và nó yêu cầu thời gian O[N] để in một hoán vị.
Không gian phụ trợ. Ô[. S. ]

Vui lòng viết nhận xét nếu bạn thấy các mã/thuật toán trên không chính xác hoặc tìm các cách khác để giải quyết vấn đề tương tự

Chủ Đề