#3671
Sum of Beautiful Subsequences
international master · 1955 · lc hard +32 · 31.3% accepted · 35 likes · top 9%
Description
Given an integer array nums, define the beauty of a positive integer g as g multiplied by the count of strictly increasing subsequences of nums whose GCD equals exactly g. Return the total beauty summed over all positive integers g, modulo 109 + 7.
Code
1
2
3