Problem 940 · Hard

Distinct Subsequences II

Count the distinct nonempty subsequences that can be taken from a string of lowercase letters. The visual tracks a running total and removes the duplicates introduced by each letter's last occurrence.

Open the interactive visualisation