You are given a string s. You need to remove all duplicate letters of this string, print the resulting string sorted in alphabetical order and also print the number of different permutations of resulting string. Input The only line of the input contains the string s.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

using c++ with comments please

Note
DEC
ASCI
DEC
ASCH
DEC
ASCI
DEC
ASCI
DEC
ASCI
DEC
ASCI
DEC
ASCH
DEC
ASCI
32
space
64
96
128
160
192
224
A
193
33
34
65
66
97
129
130
161
225
226
98
b
162
194
35
67
99
131
163
195
227
36
68
D
100
132
164
196
228
37
69
101
133
165
197
229
38
70
102
134
166
198
230
39
71
103
135
167
199
231
40
72
104
136
168
200
232
10
41
73
105
137
169
201
233
11
42
74
106
138
170
202
234
12
43
75
76
107
139
140
171
203
235
236
237
13
108
204
205
44
172
14
45
77
M
109
141
173
15
46
78
110
142
174
206
238
16
47
79
111
143
175
207
239
17
48
80
112
144
176
208
240
18
49
81
113
145
177
209
241
19
s0
2
82
R
114
146
178
210
242
20
51
3
83
115
147
179
211
243
21
52
4
84
116
148
180
212
244
22
53
85
117
149
150
151
181
213
245
118
246
23
24
54
86
87
182
183
184
214
215
247
248
249
w
119
25
56
88
120
152
216
217
218
26
57
89
121
153
154
185
186
27
58
90
122
123
250
28
59
91
155
187
219
251
29
60
92
124
156
188
220
252
30
61
93
125
157
189
221
253
31
62
94
126
158
190
222
254
63
95
127
159
191
223
255
space
----
AAS
YA. ...
......
o OAT En -1IJI
Transcribed Image Text:Note DEC ASCI DEC ASCH DEC ASCI DEC ASCI DEC ASCI DEC ASCI DEC ASCH DEC ASCI 32 space 64 96 128 160 192 224 A 193 33 34 65 66 97 129 130 161 225 226 98 b 162 194 35 67 99 131 163 195 227 36 68 D 100 132 164 196 228 37 69 101 133 165 197 229 38 70 102 134 166 198 230 39 71 103 135 167 199 231 40 72 104 136 168 200 232 10 41 73 105 137 169 201 233 11 42 74 106 138 170 202 234 12 43 75 76 107 139 140 171 203 235 236 237 13 108 204 205 44 172 14 45 77 M 109 141 173 15 46 78 110 142 174 206 238 16 47 79 111 143 175 207 239 17 48 80 112 144 176 208 240 18 49 81 113 145 177 209 241 19 s0 2 82 R 114 146 178 210 242 20 51 3 83 115 147 179 211 243 21 52 4 84 116 148 180 212 244 22 53 85 117 149 150 151 181 213 245 118 246 23 24 54 86 87 182 183 184 214 215 247 248 249 w 119 25 56 88 120 152 216 217 218 26 57 89 121 153 154 185 186 27 58 90 122 123 250 28 59 91 155 187 219 251 29 60 92 124 156 188 220 252 30 61 93 125 157 189 221 253 31 62 94 126 158 190 222 254 63 95 127 159 191 223 255 space ---- AAS YA. ... ...... o OAT En -1IJI
Problem I. How many permutations?
Input file:
Output file:
standard input
standard output
Time limit:
1 second
Memory limit:
256 megabytes
You are given a string s. You need to remove all duplicate letters of this string, print the resulting string
sorted in alphabetical order and also print the number of different permutations of resulting string.
Input
The only line of the input contains the string s.
Output
Print the resulting string on the first line and number of permutations on the second one.
Examples
standard input
standard output
abcabc
abc
6
cdbaaa
abcd
24
Transcribed Image Text:Problem I. How many permutations? Input file: Output file: standard input standard output Time limit: 1 second Memory limit: 256 megabytes You are given a string s. You need to remove all duplicate letters of this string, print the resulting string sorted in alphabetical order and also print the number of different permutations of resulting string. Input The only line of the input contains the string s. Output Print the resulting string on the first line and number of permutations on the second one. Examples standard input standard output abcabc abc 6 cdbaaa abcd 24
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education