File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -223,22 +223,22 @@ def countSubstrings(self, s: str) -> int:
223
223
while center <= original_center + original_radius :
224
224
# Calculate the "mirrored" center for the current center.
225
225
mirrored_center = original_center - (center - original_center )
226
- # Calculate the maximum possible radius of the palindrome centered
227
- # at `center`.
226
+ # Calculate the maximum possible radius of the palindrome
227
+ # centered at `center`.
228
228
max_radius = original_center + original_radius - center
229
229
230
- # Case 1: Palindrome of mirrored center lies entirely within the
231
- # original palindrome.
230
+ # Case 1: Palindrome of mirrored center lies entirely within
231
+ # the original palindrome.
232
232
if palindrome_radii [mirrored_center ] < max_radius :
233
233
palindrome_radii [center ] = palindrome_radii [mirrored_center ]
234
234
center += 1
235
- # Case 2: Palindrome of mirrored center extends beyond the boundary
236
- # of the original palindrome.
235
+ # Case 2: Palindrome of mirrored center extends beyond the
236
+ # boundary of the original palindrome.
237
237
elif palindrome_radii [mirrored_center ] > max_radius :
238
238
palindrome_radii [center ] = max_radius
239
239
center += 1
240
- # Case 3: Palindrome of mirrored center extends exactly up to the
241
- # boundary of the original palindrome.
240
+ # Case 3: Palindrome of mirrored center extends exactly up to
241
+ # the boundary of the original palindrome.
242
242
else :
243
243
radius = max_radius
244
244
break
You can’t perform that action at this time.
0 commit comments