Leetcode 3671. Sum of Beautiful Subsequences | Hello Interview