Skip to content

Commit fa16a8f

Browse files
authored
Improved task 3612
1 parent b79d93c commit fa16a8f

File tree

1 file changed

+12
-78
lines changed
  • src/main/kotlin/g3601_3700/s3612_process_string_with_special_operations_i

1 file changed

+12
-78
lines changed

src/main/kotlin/g3601_3700/s3612_process_string_with_special_operations_i/readme.md

Lines changed: 12 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,13 @@ Return the final string `result` after processing all characters in `s`.
2121

2222
**Explanation:**
2323

24-
`i`
25-
26-
`s[i]`
27-
28-
Operation
29-
30-
Current `result`
31-
32-
0
33-
34-
`'a'`
35-
36-
Append `'a'`
37-
38-
`"a"`
39-
40-
1
41-
42-
`'#'`
43-
44-
Duplicate `result`
45-
46-
`"aa"`
47-
48-
2
49-
50-
`'b'`
51-
52-
Append `'b'`
53-
54-
`"aab"`
55-
56-
3
57-
58-
`'%'`
59-
60-
Reverse `result`
61-
62-
`"baa"`
63-
64-
4
65-
66-
`'*'`
67-
68-
Remove the last character
69-
70-
`"ba"`
24+
| i | s[i] | Operation | Current `result` |
25+
|---|-------|----------------------------|------------------|
26+
| 0 | `'a'` | Append `'a'` | `"a"` |
27+
| 1 | `'#'` | Duplicate `result` | `"aa"` |
28+
| 2 | `'b'` | Append `'b'` | `"aab"` |
29+
| 3 | `'%'` | Reverse `result` | `"baa"` |
30+
| 4 | `'*'` | Remove the last character | `"ba"` |
7131

7232
Thus, the final `result` is `"ba"`.
7333

@@ -79,37 +39,11 @@ Thus, the final `result` is `"ba"`.
7939

8040
**Explanation:**
8141

82-
`i`
83-
84-
`s[i]`
85-
86-
Operation
87-
88-
Current `result`
89-
90-
0
91-
92-
`'z'`
93-
94-
Append `'z'`
95-
96-
`"z"`
97-
98-
1
99-
100-
`'*'`
101-
102-
Remove the last character
103-
104-
`""`
105-
106-
2
107-
108-
`'#'`
109-
110-
Duplicate the string
111-
112-
`""`
42+
| i | s[i] | Operation | Current `result` |
43+
|---|-------|---------------------------|------------------|
44+
| 0 | `'z'` | Append `'z'` | `"z"` |
45+
| 1 | `'*'` | Remove the last character | `""` |
46+
| 2 | `'#'` | Duplicate the string | `""` |
11347

11448
Thus, the final `result` is `""`.
11549

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy