Beautiful Subsequences

You are given a string. You have to find the number of beautiful subsequences in the string.


This is a companion discussion topic for the original entry at https://toph.co/p/beautiful-subsequences