ā” Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 21s17 days 22 hours 20 minutes 21 seconds.
ā” Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 21s17 days 22 hours 20 minutes 21 seconds.

Sign in to watch this lesson
Advanced - Strings Ā· 3:51
A string can hold a quadratic number of palindromes, but two arrays of radii, d_odd and d_even, describe them all. Interleaving # turns both kinds into odd palindromes so one array does the job, and Manacher's algorithm fills it in linear time by mirroring arcs inside the rightmost palindrome found so far and growing only past its edge. We trace #a#b#c#b#c#b#a# arc by arc, watch the right edge move only forward, and count palindromes in a long long.