We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You need to store only the length of the largest streak per character, that is, 26 numbers. Queries would be done with a loop over the weights and the divmod function, a modest overhead. Note that the 26-number table fits into the first-level cache (if not the register set), while your huge storage will cause L1 misses most of the time.
Weighted Uniform Strings
You are viewing a single comment's thread. Return to all comments →
You need to store only the length of the largest streak per character, that is, 26 numbers. Queries would be done with a loop over the weights and the divmod function, a modest overhead. Note that the 26-number table fits into the first-level cache (if not the register set), while your huge storage will cause L1 misses most of the time.