Skip to content

Commit e94583c

Browse files
rajenderthotaidoocs
authored andcommitted
style: format code and docs with prettier
1 parent aa47900 commit e94583c

File tree

1 file changed

+3
-1
lines changed
  • solution/3300-3399/3335.Total Characters in String After Transformations I

1 file changed

+3
-1
lines changed

solution/3300-3399/3335.Total Characters in String After Transformations I/README_EN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ tags:
107107
<!-- description:end -->
108108

109109
## Solutions
110+
110111
To solve this problem efficiently, we cannot simulate every transformation by building the actual string (as the length may grow exponentially). Instead, we track the length of each character's transformation result using dynamic programming.
111112

112113
💡 Idea:
@@ -128,6 +129,7 @@ To solve this problem efficiently, we cannot simulate every transformation by bu
128129
For each transformation step i from 1 to t, compute the length for each character.
129130

130131
For the final result, sum dp[t][s.charAt(i)] for all characters in s.
132+
131133
<!-- solution:start -->
132134

133135
### Solution 1
@@ -170,7 +172,7 @@ class Solution:
170172
class Solution {
171173

172174
private static final int MOD = 1_000_000_007;
173-
175+
174176
public int lengthAfterTransformations(String s, int t) {
175177
int[][] dp = new int[t + 1][26]; // dp[i][c] = length of result string after i transformations of char c
176178

0 commit comments

Comments
 (0)