Compute maximum beauty of a string | Bank of America